-3

please give sql query to change or rename the sql database name

1 Answers1

0

MS SQL Server: ALTER DATABASE "old_name" MODIFY NAME = "new_name"

MySQL: While there used to exist a simple RENAME DATABASE command in older versions of MySQL which was intended to perform this task, RENAME DATABASE has since been removed from all newer versions to avoid security risks.

Your option is either to dump and reimport the database or to create a new one and move the tables.

There are other options for MySQL and other types too.
Please do a search.

Timothy Alexis Vass
  • 2,238
  • 2
  • 7
  • 25