I have 200k records in one table and I want to insert these records into another table. I read about the bulk insert but the query I found on msdn website is just not making any sense. This is the query What is f:orderslineitem.tbl and the whole this is just not making any sense. I have a table with four
Tag: sql-server
Do I need a where clause in a conditional UPDATE?
We imported a lot of data from another table. Now I’m trying to correct some of them. I didn’t use ELSE because many rows have valid country. My question is to know whether I need to the WHERE clause to filter the rows that will be affected? The reason I’m asking this question is that, IR…
SQL query to search for room availability
The follow tables I have are: CUSTOMERS (CustomerID, firstname, surname etc) ROOMS (RoomID, RoomType, Description) BOOKING (BookingID, CustomerID, Arrival Date, Departure Date, number of people, …
Sharing composite foreign key based on the same columns across multiple tables in MS SQL Server
I have database with multiple tables which contains information about different instruments (Currencies, Funds, Equities etc.). All instruments have Type and Id fields which represents unique key for …
how to get current/Todays date data in sql server
how to write query to get today’s date data in SQL server ? select * from tbl_name where date =
SQL – Convert String to Date and compare – Conversion failed when converting datetime from character string
I currently have dates stored in a general attribute field in the database as a string. They are all stored in the format DD/MM/YYYY for example 01/01/2000 I am able to convert them them to datetime …
SQL Server: Replace invalid XML characters from a VARCHAR(MAX) field
I have a VARCHAR(MAX) field which is being interfaced to an external system in XML format. The following errors were thrown by the interface: mywebsite.com-2015-0202.xml:413005: parser error : …
using sql – Is not null in a select statement
I can’t seem to figure out how to use the opposite of isnull or ifnull statements in sql. I need to say if a.Error1 is not null — then print the ‘ – ‘ and the + CHAR(13)+CHAR(10). Basically There should be no dash or no new line break if the a.Error1 comes back null. So print the…
How to declare sql variable in C#
My requirement is to remove all record but one from a table. For this I am executing a series of two different sql commands. Seems like on ssms it works fine but with C# is not –This is what I run …
Sql Server select datetime without seconds
I have datetime column value below I tried below and These are did not work for me How can i get above datetime as 01-04.2015 20:37 ? Answer In SQL Server this will work: