Skip to main content

@schedule_uid is not a parameter for procedure sp_add_jobschedule - Error when creating a schedule job from script for SQL Server 2005

A few days back when I was working with server migration, it was needed to migrate scheduled jobs also. What I did wrong? What’s the solution?

I had to move all scheduled jobs for SQL server 2005 where the source SQL server version and destination SQL server version is same. I generated a script of all jobs from another instance of SQL server 2008 or higher version in different server by connecting said source SQL server 2005 instance. After it gave an error while applying that script for jobs at the destination which is following,
Msg 8145, Level 16, State 1, Procedure sp_add_jobschedule, Line 0
@schedule_uid is not a parameter for procedure sp_add_jobschedule.
It will work fine if generates a script from SQL server 2005 instance. With 2008 or higher version, it adds parameter in script “@schedule_uid” and it creates an issue. To apply the script at destination either you have to remove @schedule_uid and its value from script or apply setting forScript for server version’ from options.
Go to Tools –> Options –> SQL Server Object Explorer  and change value to required version of Script for server version’.

I applied above settings and succeed for me. Please share your ideas and comments for such issue.
Have a nice day. Stay tuned for more!