Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server could not find stored procedure 'show'

I can't use the most basic procedure, show, as it throws an error:

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

I used:

SHOW DATABASES

Please help me find answers to this issue.

like image 217
Ashot Bagdasaryan Avatar asked Jun 30 '16 22:06

Ashot Bagdasaryan


People also ask

Can not find stored procedure SQL Server?

This error states “Could not find stored procedure 'GO'“. It simply means that the SQL Server could found the stored procedure with the name “GO“. Now, the main reason behind this error could be the misuse of the “GO” statement.

How Show stored procedure in SQL Server?

Stored procedures can't "show messages". Then can return either an OUTPUT parameter OR a record set. It's up to your application to determine what to do with the results. That said, you can "print" a message which is similar to simply selecting some text: see stackoverflow.com/questions/6912102/…

Could not find stored procedure error 2812?

Explanation. This error occurs when you attempt to execute a stored procedure that does not exist. If the procedure actually does exist, that is, it appears when sp_help is run with no parameters, error 2812 can occur if the procedure name was not fully qualified.

Why set Nocount on is used in SQL?

SET NOCOUNT ON prevents the sending of DONEINPROC messages to the client for each statement in a stored procedure.


1 Answers

To list all Databases in SQL Server,

Select * from sys.databases 

To exclude in-built DBs,

Select * from sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb'); 
like image 61
SharK Avatar answered Sep 25 '22 20:09

SharK