Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Just wondering if this is a properl

Status
Not open for further replies.

PushCode

Programmer
Dec 17, 2003
573
US
Just wondering if this is a properly formatted Stored Procedure. It is intended to run a DTS package.

The SQL server resides on a Windows 2003 server, so I'm wondering if 'xp_cmdshell' is wrong.

CREATE PROCEDURE doPublish
AS exec master..xp_cmdshell 'dtsrun /S216.197.96.3 /NIAR_import_JAY_for_members /E'
GO
 
Looks fine. The only issue may be in running the xp_cmdshell xsproc. Some folk/companies do not like to use xp_cmdshell for security reasons.

If this is the case, you could create a job and as one of the jobs steps, fire off the DTS package from there. Of course you would have to change the SP to fire off the job instead. Something like ...

EXEC MSDB..sp_start_job @job_name = 'MyDTSJob'



Thanks

J. Kusch
 
Thanks JayKusch,

I'm not familiar with the term 'job'. What do you mean by that?
 
a Job is a task, or group of tasks, that are run manually or set to run on a schedule. Look in Enterprise Manager under Management..SQL Server Agent..Jobs. Right-mouse click the Jobs folder and choose New Job. That will give you an idea as to what a job template looks like. Then jump into BOL(Books OnLine) and read up on jobs. Jobs are VERY USEFUL!

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top