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 |
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-11-27 : 03:22:44
|
| Hi All,I have created on Package in SQL 2000 Pak_Emp_Load.Now i wanted to execute this DTS Package through procedure in SQL Query Analyzer.Please suggest |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-11-27 : 03:25:05
|
| you can use DTSRun command line utility for thathttp://www.mssqltips.com/tip.asp?tip=1007you need to execute this using xp_cmdshell extended proc in your procedure.My question is why do you want this to be done from procedure?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-11-27 : 03:34:50
|
| I am using VB.Net and i have created one module where user will upload the excel file.And for uploading i have creaed one package |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-11-27 : 03:37:12
|
| ok. does the upload has to happen in real time? or else it would be better to make it scheduled periodically------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-11-27 : 03:39:29
|
| No user will upload the data |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-11-27 : 03:45:24
|
| ok. even then you can choose to have data being uploaded immediately on submission or do it as per scheduled period------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-11-28 : 22:34:00
|
| I agree with Visakh. Also, why not do the upload all in VB.Net?Anyway, to directly answer your question, if you're going to do it this way, I would create a SQL Agent job to execute the DTS package, then use sp_start_job inside the stored procedure to fire the job off. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-12-01 : 13:00:44
|
| seehttp://jasonhaley.com/blog/post/2004/03/14/Running-a-DTS-package-from-a-Stored-Procedure-(sort-of)-.aspx------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|