More DBA job interview questions and answers at
http://dba.fyicenter.com/Interview-Questions/
(Continued from previous question...)
What would happen when you execute the code below in Query Analyzer (SQL Server 2000) Submitted by Jacek Osuchowski...
What would happen when you execute the code below in Query Analyzer (SQL Server 2000) Submitted by Jacek Osuchowski:
USE Northwind
GO
CREATE PROCEDURE sp_who
AS
PRINT 'SURPRISE'
GO
EXECUTE sp_who
Answer
Information about current SQL Server users and processes is displayed.
Explanation
The explanation could be found in the Books Online under Creating a Stored Procedure. One of the sections, named System Stored Procedures which describes how SQL Server looks up the system stored procedure has this note:
Important If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed.
(Continued on next question...)