Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

T-SQL to Deploy 1

Status
Not open for further replies.

smedvid

MIS
Joined
May 28, 1999
Messages
1,228
Location
US
I am a developer and I have a deploy T-SQL Script that is designed to be used by deployment team under Query Analyzer.... I placed tons of comments and have a USE Statement to insure that proper database is active before SQL is executed. Only issue is that the deployment team executed the script against the Model environment instead of Prod. They were connected to the Model box.

Is there anything like a Connection String I can place in my T-SQL Code to insure that it is run on the Prod environment? I want to prevent this from reocurring.

TIA;

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
You could include, in your script, something like this...

If @@ServerName <> '[red]<Servername>[/red]'
Return

Replace the part in red with your server name.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Excellent!!!!!!!
Certainly worthy of a star!
And yet so simple - I should have thought of it!
Thanks Again!

Steve Medvid
&quot;IT Consultant & Web Master&quot;

Chester County, PA Residents
Please Show Your Support...
 
Glad to help. And it looks like we are 'almost' neighbors. I'm from Montgomery County, PA.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top