all groups > sql server dts > february 2006 >
You're in the

sql server dts

group:

How to use a "dynamic" file name (.XLS) in the DTS as a datasource file ? URGEN


How to use a "dynamic" file name (.XLS) in the DTS as a datasource file ? URGEN Ahmed Jewahar
2/19/2006 9:53:36 PM
sql server dts:

Hi.

I desgined a DTS which will load .XLS file which static file name. For
instance, mydata.xls. I have a ASP.NET (vb.net) application which will
allow user to "upload" the file from client machine to webserver.

In the applicaiton, the uploaded file will be saved in the server as
"mydata.xls". Upon saving the file, application will call a SP which is
basically to execute DTS package which will upload data from
"myData.xls" into a table called "dataMaster". Below is the SP codes:

exec master..xp_cmdshell 'dtsrun /S "myServer" /U "user" /P "pwd" /N
"fileUPLOAD"'
IF @@ERROR <> 0 -- Error reported DTS failed
Begin
print 'Error: DTS has been failed !'
RETURN 99
End
Else
Begin
print 'DTS is success !'
RETURN 0
End

Now, I have more than one users and they all have to upload .XLS file
(format is same) from their machine. In that case, I can not use
"static" file name as datasource file name. Currently I use
"myData.XLS".

I need to use a Dyanmic file name as my datasource file (.XLS file and
format remain same) in my DTS to upload data into SQL table.

How can I do this in DTS ? I'm new to DTS so, pls advise bit more
details.

Regards,




Re: How to use a "dynamic" file name (.XLS) in the DTS as a datasource file ? URGEN Allan Mitchell
2/20/2006 5:59:48 AM
Hello Ahmed,

You can provide to the correct connection the DataSource property of where
the file will be. You can set this to be a variable. Because you are using
DTSRUN you can pass in a value for the variable using the /A switch.



Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button