Re: renaming database

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/09/04

  • Next message: Vishal Parkar: "Re: renaming database"
    Date: Fri, 9 Jul 2004 11:43:35 +0530
    
    

    Hi,

    Follow the below steps to rename a database in SQL server 2000.

    1. Remove all the users connected to the database

      alter database <dbname> set single_user with rollback immediate

    2. Run the below command to rename the database

      alter database <current_db_name> modify name=<new_db_name>

    3. Set to multi user mode

      alter database <dbname> set multi_user

    --
    Thanks
    Hari
    MCDBA
    "dave" <anonymous@discussions.microsoft.com> wrote in message
    news:28e1e01c4654c$a8962ab0$a601280a@phx.gbl...
    > I tried to renaming database using query analyser of sql
    > server 2000 but I got this error msg.
    >
    > Server: Msg 5030, Level 16, State 2, Line 1
    > The database could not be exclusively locked to perform
    > the operation.
    >
    > My sysntax was
    > sp_renamedb 'old_dbname', 'new_dbname'
    >
    > How to handle this? what could be the solution?
    > Thanx
    > Dave
    

  • Next message: Vishal Parkar: "Re: renaming database"

    Relevant Pages

    • Re: Change Field Name in Table
      ... try to figure out the delete and/or renaming it again. ... table with the make Table query or even using the DoCmd Copy. ... move everything over to another database and use the new database. ... was Imported and you should be able to rename it. ...
      (microsoft.public.access.formscoding)
    • Re: Security Wizard
      ... you can't just rename/delete all existing mdw files. ... If you found system.mdw and renamed it, just rename it back to system.mdw and try and open Access. ... Accounts and Encrypt/Decrypt the database. ... Security Wizard at this time': ...
      (microsoft.public.access.gettingstarted)
    • Re: How to Rename Database Files
      ... Once the database is detached, SQL Server can rename the physical files ...
      (microsoft.public.sqlserver.server)
    • Re: MS Access "Upsizing" Tools in SQL Server
      ... Create the database manually (on SQL Server 2005), ... window, choose Link Tables, choose ODBC Databasesand then choose the DSN ... You'll want to rename the old tables to "tableName_old" then rename the ...
      (microsoft.public.sqlserver.tools)
    • Re: Constants for DB Fields in Front End a good idea?
      ... When a database entity changes, ... you get a runtime error that ... the DBA renamed FirstNM to FirstName. ... could care less if the DBA decides to rename column FName to FirstName ...
      (microsoft.public.dotnet.languages.csharp)