OpenRowset Function | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

OpenRowset Function

Hi all, insert into Table_test
SELECT test_ID,test_name
FROM OPENROWSET(BULK ‘C: est.txt’,
FORMATFILE = ‘c: est.fmt’,
errorfile=’c:error.txt’)
AS C(test_id, test_name) This was the code used to import data from flat file.
It was successful when data was in the correct format. But i want the errors to be wrriten to the error file when some rows having improperdata.
Data in the text file. 7ram
8suresh
rsuresh This is the scenaria when i am passing char value in place of int like "r"
Error file is not been created and even the two rows before that row was also not inserted.
]]>