Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Import data

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2007-04-11 : 05:15:47
Hi,
I have one excel sheet with data and I want to import the excel sheet data into database.
So how I can import the data into database using SQL statement?

SQLTeam

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-11 : 05:31:36
DTS
SSIS

This topic http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926
It is about EXPORT but can also be used for import.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

shubhada
Posting Yak Master

117 Posts

Posted - 2007-04-11 : 06:05:06
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;',
'SELECT * FROM [SheetName$]') select * from colors

i tried the above query but i am getting the following error.Plz let me know about this error

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.


SQLTeam
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-11 : 06:09:08
That is for EXPORT.
You have to make sure that the path to the file is relative to the server NOT your computer.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -