Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database exists?

Status
Not open for further replies.

LesStockton

Programmer
Mar 29, 2005
20
US
What's the SQL statement to test if a database by name, exists?
 
Two ways:
[tt]
SHOW DATABASES LIKE 'dbname'
[/tt]
and, more recently:
[tt]
SELECT *
FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'dbname'
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top