T-SQL Tutorial

Msg 2812 Level 16 - Could not find stored procedure


On Transact SQL language the Msg 2812 Level 16 - Could not find stored procedure means that the procedure name is misspelled or does not exist.

Msg 2812 Level 16 Example:

We have the procedure getStudents:

USE model;
GO
CREATE PROCEDURE getStudents
   @LastName nvarchar(50)
AS
SELECT id, first_name, last_name
   FROM students
WHERE last_name = @LastName
ORDER BY first_name
GO

Invalid execution:

USE model;
GO
EXEC getStudents123 'DAVIS'
GO

Message
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'getStudents123'.

Correct execution:

USE model;
GO
EXEC getStudents 'DAVIS'
GO

idfirst_namelast_name
3SophiaDAVIS

Other error messages: