How to copy SQL jobs from one SQL instance to another.

I am trying to copy several SQL jobs from our test server to production. When I run the scripts to drop and create these jobs I get messages like these.  What must I do to these scripts to get them to run successfully on the production server?

Msg 14262, Level 16, State 1, Procedure sp_verify_job_identifiers, Line 43
The specified @job_id ('C09EF46A-E6EC-4074-B5F3-A932F5B5B495') does not exist.
Msg 14234, Level 16, State 1, Procedure sp_verify_job, Line 203
The specified '@owner_login_name' is invalid (valid values are returned by sp_helplogins [excluding Windows NT groups]).
LVL 1
rwheeler23Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
>> The specified @job_id ('C09EF46A-E6EC-4074-B5F3-A932F5B5B495') does not exist.

Please be noted that Job ID is a uniqueidentifier and hence can't force the values to be same across Servers.
If you have IF EXISTS or IF NOT EXISTS for DROP/CREATE job, then request you to change it to use Job name instead to get it work..
or else, you can simply ensure that those jobs are not already there in the target server and simply execute the CREATE job scripts to get it work fine.

>> The specified '@owner_login_name' is invalid (valid values are returned by sp_helplogins [excluding Windows NT groups]).

This indicates that one of the Job owner login in Test Server is not available in Prod Server. either create the Login in Prod or just check for these login names in your script(Just Ctrl+F) and replace those values with some valid prod login to get it work..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rwheeler23Author Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.