![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
From: "new.smicrosoft.com" <123 (AT) 123 (DOT) com Subject: Populate a DB from Excel Date: Thu, 6 Jan 2005 07:47:33 +0530 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <OdO2L#18EHA.1692 (AT) TK2MSFTNGP10 (DOT) phx.gbl Newsgroups: microsoft.public.sqlserver.dts NNTP-Posting-Host: 61.1.101.126 Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.p |
|
Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.dts:54121 X-Tomcat-NG: microsoft.public.sqlserver.dts Hi, I am writing an installer for a database driver application. The installer is supposed to create the DB, tables and populate the tables with sample data from an excel file. The excel file containing the sample is generated via the DTS wizard from an existing production DB. The application will be installed on a system different fromt he one where the SQL server is installed. At this point I am able to create the DB and the Table using vbscript. I am howerver not able to impor the data from the excel sheet. It seems the excel sheet needs to be stored locally on the SQL server machine for import to work .. is this correct ? Is there any other way to populate the remote DB using an excel file on my machine. - Rohit |
#3
| |||
| |||
|
|
Hi Rohit, You may want to add a linked server points to the Excel file on your machine. To do this you need to place the Excel in a shared folder on your machine and run a command similar to the following against the SQL Server: sp_addlinkedservr @server='LinkedExcel', @srvproduct='', @provider='Microsoft.Jet.OLEDB.4.0', @datasrc='\\yourmachinename\sharedfolder\excelfile name.xl s', @provstr='Excel 5.0' Then you consider LinkedExcel to be a SQL Server and run a INSERT...SELECT to populate the data. Please refer to the following topic in BOL for more information: http://msdn.microsoft.com/library/en...ata/ac_8_md_03 _8vhw.asp If anything is unclear, feel free to let me know. Sincerely, William Wang Microsoft Online Partner Support Get Secure! - <www.microsoft.com/security ================================================== === When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== === This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- From: "new.smicrosoft.com" <123 (AT) 123 (DOT) com Subject: Populate a DB from Excel Date: Thu, 6 Jan 2005 07:47:33 +0530 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <OdO2L#18EHA.1692 (AT) TK2MSFTNGP10 (DOT) phx.gbl Newsgroups: microsoft.public.sqlserver.dts NNTP-Posting-Host: 61.1.101.126 Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.p hx.gbl!TK2MSFTNGP10.phx.gbl Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.dts:54121 X-Tomcat-NG: microsoft.public.sqlserver.dts Hi, I am writing an installer for a database driver application. The installer is supposed to create the DB, tables and populate the tables with sample data from an excel file. The excel file containing the sample is generated via the DTS wizard from an existing production DB. The application will be installed on a system different fromt he one where the SQL server is installed. At this point I am able to create the DB and the Table using vbscript. I am howerver not able to impor the data from the excel sheet. It seems the excel sheet needs to be stored locally on the SQL server machine for import to work .. is this correct ? Is there any other way to populate the remote DB using an excel file on my machine. - Rohit |
![]() |
| Thread Tools | |
| Display Modes | |
| |