I have a stored procedure that performs bulk insertion into a SQL Server 2005 database. When I call this stored procedure from some SQL (passing the name of the local format file and data file), it works fine. Everytime.
However, when the same stored procedure is called from C # .NET 3.5 code using SqlCommand.ExecuteNonQuery
, it works intermittently.
When a failure is created SqlException
, indicating:
Impossible in bulk. Invalid column number in file format "c: \ bulkinsert \ MyFile.fmt"
I do not think this error message is correct.
Has anyone encountered similar issues with calling bulk insert from code?
Thanks.
Nick Wright