![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Microsoft office error all errors related to Microsoft office error |
![]() |
|
Import data from Excel file in database using stored procedure, DTS
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Fixed Error!
Posts: 4,202
Join Date: Mar 2007
Rep Power: 6
IM:
|
Like in MS-SQL we can directly import the Excel file into the table of database using wizard Is there is anyway in MS-SQL-2005, where we can import the EXCEL file directly using stored procedure. My Excel file has the bulk data in bulk. I mean using DTS or something... I donot have much knowledge about DTS, which I have mentioned above. I have heard that this can be done. Please guide me the best way to import the excel file using MS-SQL2005 in stored prcedure |
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Fixed Error!
Posts: 4,202
Join Date: Mar 2007
Rep Power: 6
IM:
|
EXEC sp_addlinkedserver 'VirtualServer', @srvproduct = '', @provider = 'Microsoft.Jet.OLEDB.4.0', @datasrc = 'C:\TestExcelFile.xls', @provstr = 'Excel 8.0;' GO -- map logins to linked server from local server EXEC sp_addlinkedsrvlogin 'VirtualServer', 'false' GO -- Get the spreadsheet data via OpenQuery where spreadsheet name is TestExcelFile SELECT * FROM OPENQUERY (VirtualServer, 'select * from [TestExcelFile]') |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|