KirbyWallace
Programmer
I have a script that does various maintenance things to a database that's kept on a backup server. It resets all passwords to blanks, empties certain temp tables, drops and readds all users, etc etc. It creates a test system from a backup of the live system.
It would be a disaster if this script were run against the live database server. But SSMS makes it VERY easy to do jsut that. (Granted I have the custom colour bar in the query window to "help")...
What I need is a way to USE [server] in much the same way that I can USE [database]. That way I can code the script so that it cannot run against the live server.
Is there such a thing?
Thanks
Code:
USE [master]
ALTER DATABASE [ips_pathway_services] SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
It would be a disaster if this script were run against the live database server. But SSMS makes it VERY easy to do jsut that. (Granted I have the custom colour bar in the query window to "help")...
What I need is a way to USE [server] in much the same way that I can USE [database]. That way I can code the script so that it cannot run against the live server.
Is there such a thing?
Thanks