Link to home
Start Free TrialLog in
Avatar of r_pat72
r_pat72

asked on

SQL SCRIPT for SQL Job (sql 2008)

Hi,

I have created a SSIS package.I need to run this SSIS package inside a sql job nightly under a service account.

Could someone give me sample sql script for creating sql job. I don't want to create job from sql server management studio. The reason for sql script is that I can deploy this script to any server.

Name of SSIS Package : datarefresh.dtsx
Name of service account : test

Thanks for help.
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

you can create the job in the management studio and then in the last step of the wizard instead of doing the final create job, you just choose - script as sql task
this will give you the script you need

another option is to create the job with management studio, and the right click it and choose the generate ddl option
then once you have the ddl, delete the job
Avatar of lcohan
If you want to run the SSIS (DTSX) as file then create a new SQL Job like screenshot below and hit SCRIPT buton not the OK and keep in mind that ANY SQL Job unless specified runs under the SQL Agent Service account - in other words whatever starts SQL Server Agent under services. If you need to store the DTSX in Integration Servvices (SSIS server) then you can Reight Click the package and schedule it from there and hit the script buton not the OK.
SSISJob.png
ASKER CERTIFIED SOLUTION
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial