/*
ALTER DATABASE [DBNAME] SET SINGLE_USER WITH NO_WAIT
OR
ALTER DATABASE <[DBNAME]> SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
SP_RENAMEDB <[oldname]>,<[Newname]>
GO
ALTER DATABASE [NEWDBNAME] SET MULTI_USER WITH NO_WAIT
OR
ALTER DATABASE <[NEWDBNAME]> SET MULTI_USER -- set back to multi user
GO
*/
ALTER DATABASE MasterNameSearch SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
SP_RENAMEDB MasterNameSearch,MasterSearch_Elk
GO
ALTER DATABASE MasterSearch_Elk SET MULTI_USER -- set back to multi user
GO