Stored procedures, tables and views in master database with prefix sp_ are accessible in user databases. If in user database exists the same object as in the master database, the user database object has higher priority to be used. Here is a demo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | use master go create procedure sp_v1 as select 1 go use myDb go exec sp_v1 --1 go create procedure sp_v1 as select 2 go exec sp_v1 --2 |
Leave a Reply