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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-09-05 : 08:40:50
|
| archie writes "I need to import an excel spreadsheet into a SQL7 database using DTS. I've set this up in DTS and imported no problem. Now I have setup an ASP page for users to supply the xls file name & path on their local client. The ASP calls a stored procedure which receives the file name & path. The SP then starts the DTS package. I'm sure you already see the problem coming. How do I get the DTS package to use different file names on demand? I've been experimenting with DTSGlobalVariables. From all the searching & reading I've done with this problem, that seems to be the way to go but I haven't been able to make it work. I've been using the ASP to import but I'm pretty sure the DTS will take the load off my server.I've posted this problem on many sites, there seems to be little known. I received little to none in responses.Thanks for any thoughts,archieP.S. If you have answers, please use exact code & where the code should run, ie asp, sp, dts." |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-09-05 : 10:05:59
|
| In the SQL 2K version of DTSRun.exe allows you to pass parameters to a DTS Package at run time. SQL 7 does not have this feature.You could populate a table with the file path and then create a custom ActiveX script in your DTS package that queries the table and sets the source. It should look something like this, except you would need to build your sSourceTable variable from the query.You may have a mess on your hands if the formatting of the excel spreadsheet is different from client to client ....Jay White{0} |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-09-05 : 11:40:31
|
| For v7 you can use the dts object model to set the parameters.Or you could put them in a table and get the package to read them at the start.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|