Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Bulk Insert

Author  Topic 

ncurran217
Starting Member

23 Posts

Posted - 2012-05-22 : 11:40:37
When I do a bulk insert of a csv file am I able to do this type of statement?


WHERE (purchdate >= DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)) AND (purchdate < DATEADD(day, DATEDIFF(day, 0, GETDATE()) + 1, 0)) AND (CancelDate IS NULL)

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-05-22 : 12:23:13
Not with BULK INSERT, but you can use OPENROWSET with the BULK option and apply a WHERE clause. There's more information here:

http://msdn.microsoft.com/en-us/library/ms190312.aspx
http://msdn.microsoft.com/en-us/library/ms175915.aspx
Go to Top of Page

ncurran217
Starting Member

23 Posts

Posted - 2012-05-22 : 14:28:38
Thank you very much!
Go to Top of Page
   

- Advertisement -