Hi,
I want to import data from text file.format of file is as follows:
date,id,unit_number,Quantity
05/17/2012,1,117,100
05/16/2012,2,118,100
I am using bulk insert do it.like this
BULK
INSERT vw_bulk_insert_test
FROM '\\server\c$\csvtext.txt'--\\server\SQLEXPRESS\csvtest.txt'
WITH
(FIRSTROW=2,
check_CONSTRAINTS,
FIELDTERMINATOR = '~',
ROWTERMINATOR = ''
)
GO
But 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.