2
Reply

Can we rename a database in SQL Server?

Jul 26, 2006
4.5k
0

    Yes. Definitely, using the command

    EXEC sp_dboption 'Employee', 'Single User', 'TRUE'
    EXEC sp_renamedb 'Employee', 'Employee1'
    EXEC sp_dboption 'Employee1', 'Single User', 'FALSE'

    First, you have to be an exclusive user; use sp_dboption as indicated to establish yourself as the sole user of the database. Then, just call sp_renamedb

    July 29, 2006
    0

    sp_renamedb 'olddatabse','newdatabase'

    Ranjana Goel
    July 26, 2006
    0