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
id | first_name | last_name |
---|---|---|
3 | Sophia | DAVIS |
Other error messages:
- Specified scale is invalid
- Foreign key references invalid column in referenced table
- Table already has a primary key defined on it
- Column name does not exist in the target table or view
- Violation of PRIMARY KEY constraint
- Column names in each table must be unique
- There is already an object named in the database