views:

147

answers:

4

how to rename the database using query?

A: 

About what DB are we talking? Oracle, MSSQL, MySQL, SQLite.

Do you really mean the name of the database or just a table?

I belief that it's not possible to rename the actual database by a query.

Rhapsody
A: 

SQL Server 2005 and up:

ALTER DATABASE db_name MODIFY NAME = new_db_name
Rubens Farias
A: 

For Oracle - http://www.adp-gmbh.ch/ora/admin/rename_db.html

Padmarag
A: 

For Interbase or Firebird which are single file database : you can't make it by query.

But you can rename the database when you rename the file : so it's quite easy.

Hugues Van Landeghem