Home > Archive > MS SQL Server ODBC > February 2006 > Import data from Excel into SQL server 2005









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Import data from Excel into SQL server 2005
Morten

2006-02-28, 8:24 pm

Hi!

I'm using a stored procedure to import data from an Excel sheet into SQL
Server. I used to be able to do this with a connection string that
referenced MSDASQL. However this no longer works with Windows Server 2003
X64 and SQL Server 2005 X64. Could someone show me an example that will
enable me to do this?

My connection string currently looks like:

'INSERT INTO tmpcol SELECT * FROM OPENROWSET(''MSDASQL
'',''Driver={Microsoft
Text Driver (*.txt; *.csv)}; DefaultDir=' + @path + ';'',''SELECT * FROM
import' + CONVERT(VARCHAR(200)
, @Companyid ) + '.csv'')'


Thanks in advance

Morten


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com