نحوه تعویض نام پایگاه داده SQL Server 2000

How to rename a SQL Server Database

You can not rename a SQL Server database from Enterprise Manager, but you can with the sp_renamedb stored procedure.  You must first set the database to singe user.

1. Set the database to Single User by right clicking the database in Enterprise Manager, select Properties, select the Options Tab, check the Restrict Access checkbox, and select Read-Only, then click OK.
2. Close Enterprise Manager (since we can only have 1 user accessing it at a time now).
3. Open Query Analyser.
4. Type:  sp_renamedb <oldname>, <newname>
5. Don't forget to reset the Restrict Access settings on the database that you changed in step 2.

/ 0 نظر / 6 بازدید