Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
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.aspxhttp://msdn.microsoft.com/en-us/library/ms175915.aspx