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.
Author |
Topic |
SAG2011
Starting Member
1 Post |
Posted - 2012-05-17 : 02:04:18
|
Hi,I want to import data from text file.format of file is as follows:date,id,unit_number,Quantity05/17/2012,1,117,10005/16/2012,2,118,100I am using bulk insert do it.like this BULKINSERT vw_bulk_insert_testFROM '\\server\c$\csvtext.txt'--\\server\SQLEXPRESS\csvtest.txt'WITH (FIRSTROW=2,check_CONSTRAINTS,FIELDTERMINATOR = '~',ROWTERMINATOR = '\n')GOBut before insert I want to validate values of each column.Like if second row will have values of all fields except unit_number then it should throw an error that unit_number value is missing.And it should not insert ant data after that.Please guide me on the same.Thanks in advance. |
|
|
|
|