|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Stored procedures in master database SQL Server 200/2005
Could someone please provide me with reasons why NOT to store user created
stored procedures in the master database? Thank you. -- Mike Mike
use master go create proc sp_first as select 1 go create proc spsecond as select 2 use test go exec sp_first ---1 exec spsecond --Server: Msg 2812, Level 16, State 62, Line 1 ---Could not find stored procedure 'spsecond'. sp_ prefix tells SQL Server to loking for stored procedure first in the master database. Show quoteHide quote "Mike" <M***@discussions.microsoft.com> wrote in message news:F2476E25-8F2F-4A34-9288-4D0D30C958E8@microsoft.com... > Could someone please provide me with reasons why NOT to store user created > stored procedures in the master database? > > Thank you. > -- > Mike The main issue will be portability. Just remember to script the procs out to
move them between database servers; a backup and restore of master is probably not what you want to do on dis-similar servers. A stored procedure beginning in sp_ is first searched for in master, and then the database you are in. It can be handy. -- Show quoteHide quoteAndyP, Sr. Database Administrator, MCDBA 2003 "Mike" wrote: > Could someone please provide me with reasons why NOT to store user created > stored procedures in the master database? > > Thank you. > -- > Mike
Other interesting topics
expectations for SUM query on 50+ million rows
Deadlocks "again" Move DB by backup/restore or SP_Detach? How to "Grant" a Trigger ??? IN clause with comma seperated values in select query Table comparison Page coruption Management Studio Question.... what kind of index to use in this situation. Add User to Log-Shipped Database |
|||||||||||||||||||||||