I'm trying to bulk insert a textfile into a sql server table.
The message I get is unexpected end-of-file error
Should there not be one at the end of a text file.
Please help!!
This usually means that SQL Server didn't find the number of columns that were expected. Is the input file fixed length or delimited? If fixed length, does the format file properly describe the input file? If delimited, does each row contain the same number of delimiters and columns? Terry L. Broadbent - DBA
Computing Links:
Sorry, it took awhile to respond, had to research what you were talking about with a format file.
I am a VB programmer and i have to add records to an exisitng Sql table from a text file. There could be anywhere from 40,000 to 100,000 records in each txt file.
Currently i do this with an insert statement, but this can take as much as an hour, I'm trying to find a quicker way.
Any suggestions?
Also trying to implement triggers across server but keep running to an error.
Clarify please. Does the error occur in the VB program or in a SQL BULK INSERT statement? Do you have answers for the questions I asked previously?
SQL Server provides three methods for importing data quickly - BCP, DTS and Bulk Insert. All can process hundreds of records per second. SQL Books Online (BOL) contain descriptions, syntax and samples.
If you have a specific question about triggers, please post it in another thread. Terry L. Broadbent - DBA
Computing Links:
The file is fixed length. I did not have a format file.
The errors are in the bulk statment when doned in the Enterpriser Manager. The VB program works, just slowly.
And I will send another post regarding the triggers.
When you say you are using Entreprise Manager, do you mean you are importing the file, creating a DTS package, creating a stored procedure using the BULK INSERT statement. Exactly what is the SQL Server process you are using?
Any of the methods I mentioned will generally import a file of the size you mentioned in a few seconds. Terry L. Broadbent - DBA
Computing Links:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.