Can anyone point me in a direction as to how to import data from either a text file or a spreadsheet into an existing SQL table using the osql utility. Thanks in advance!
To import files use DTS, the BCP utility or the BULK INSERT command. You can execute the BULK INSERT command using OSQL. However, BULK INSERT (and BCP) will only import text files not spreadsheets. To import spreadsheets, you must use DTS or export from Excel to a flat file and then import the flat file.
I agree with nowayout that DTS is the best option.
If you want to get the best answer for your question read faq183-874 and faq183-3179. Terry L. Broadbent - DBA
SQL Server Page:
Thanks nowayout,tbroadbent.
I created the DTS in my EM. Copied it to the server where I needed to run it. Ran it from the command prompt. Worked like a fullback draw on a prevent defense.
per my last reply - I was wrong. I could not create the package because SQL could not recognize the servername of the server where I need to run the package, as they are not connected. I will continue to research.
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.