| ||||
例如:
1.exec master.dbo.sp_executesql N'select * from table1'
2.exec pubs.dbo.sp_executesql N'select * from table1'
1调用master里的存储过程所有显示的master库里的内容
2.调用pubs里的存储过程所有显示的pubs库里的内容
但pubs里并没有sp_executesql ,因为sp_executesql是系统的存储过程,谁调用它它就对谁起作用
系统规定以sp_开头的存储过程,先在本地查找,若本地没有再到master中查找.