- Blog - http://blog.bennett-scharf.com -

Quick and Dirty CSV import to SQL Server

Posted By Bennett On 11. June 2009 @ 06:44 In Windows OS, SQL Server | No Comments

You can use LogParser (a free, unsupported utility from Microsoft) to quickly import a CSV file into a SQL Server table using syntax like this:

logparser “SELECT * INTO MyTable FROM d:\MyFile.csv” -i:csv -o:SQL -server:MyServer -database:MyDatabase -createTable:ON

There are many other uses for LogParser.  Two of the most common are analyzing Windows Event Logs and IIS logs. 


Article printed from Blog: http://blog.bennett-scharf.com

URL to article: http://blog.bennett-scharf.com/2009/06/11/quick-and-dirty-csv-import-to-sql-server/

Click here to print.