开发者

Ignore SQL errors when creating jobs

开发者 https://www.devze.com 2023-03-24 10:54 出处:网络
I am copying the SQL Agent jobs from our production SQL2008 server to a D/R server by scripting CREATE statements on the PROD server, and executing the generated T-SQL on the D/R server. This works fi

I am copying the SQL Agent jobs from our production SQL2008 server to a D/R server by scripting CREATE statements on the PROD server, and executing the generated T-SQL on the D/R server. This works fine except for jobs that reference sprocs in databases that are mirrored. In this case, I get an error like this:

Msg 954, Level 14, State 1, Line 2 The database "dbname" cannot be opened. It is acting as a mirror database.

I开发者_运维问答s there a way to have SQL ignore these errors and create the job? I could find no SET statements that do this. I am trying to avoid breaking and re-establishing the mirrors for any of the DBs affected.


Why don't you copy down the sprocs as well so your D/R environment mirrors production?

0

精彩评论

暂无评论...
验证码 换一张
取 消