Link to home
Start Free TrialLog in
Avatar of MANASH PANDEY
MANASH PANDEY

asked on

SHOW ERROR IN SQL

MY QUERY IS
SHOW DATABASES;

THEN SHOW  ERROR

Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'SHOW'.  
   WHY SHOW THIS ERROR PLZ HELP ME.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

What are you trying to do? Get a list of databases from a server?

Try
SELECT * FROM sys.databases

Open in new window

"SHOW DATABASES" is for MySQL not SQL server...

SHOW DATABASES Syntax
https://dev.mysql.com/doc/refman/5.7/en/show-databases.html
Well there are N number of ways you can get the list of databases. here are few -

1.
select * from sys.databases

Open in new window


2.
SELECT * FROM master.dbo.sysdatabases

Open in new window


3.
EXEC sp_databases

Open in new window


If you dont want system databases use below-

4.
SELECT *
FROM sys.databases
WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');

Open in new window


if you want to use any specific database use like below

USE [databaseName]
GO

E.g.
USE Master
GO
Avatar of MANASH PANDEY
MANASH PANDEY

ASKER

thanku ..
Hey Manish , Do you need more help with this
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.