September 15, 2009 at 6:08 am
When i execute exactly as u said, i got this following error
Msg 2714, Level 16, State 3, Procedure TestSpForAllDBs, Line 1
There is already an object named 'TestSpForAllDBs' in the database.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'D'.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'D'.
Whether i may be missing out anything.
September 15, 2009 at 6:13 am
Hello zehil,
Since we have previously created the sp in the master database, while the sp_msforeachdb is working for master db, we can get this error.
To eliminate the error within the sp creator procedure we can add an IF to check the database name parameter and not call the create execute statement for master database.
But I could not understand the following error messages.
Let me check the example,
Thanks for the response.
September 15, 2009 at 6:30 am
OK, I have added the following control within the CreateProcedure SP
IF @dbname 'master'
You can get the full sp code from create stored procedure on all databases using sp_MSForEachDB
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply