dbTalk Databases Forums  

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

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How to use a "dynamic" file name (.XLS) in the DTS as a datasource file ? URGEN in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ahmed Jewahar
 
Posts: n/a

Default How to use a "dynamic" file name (.XLS) in the DTS as a datasource file ? URGEN - 02-19-2006 , 11:53 PM







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,




*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How to use a "dynamic" file name (.XLS) in the DTS as a datasource file ? URGEN - 02-20-2006 , 07:59 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

Quote:
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,

*** Sent via Developersdex http://www.developersdex.com ***




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.