Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

@DatabaseName @@Servername

$
0
0

How reliable the below two statements are? I am planning to develop a generic script which should work in in all the server and database (environments) using the below two statements.

By getting the server and databases names from DEV TEST and PRODUCTION I am planning to use them with IF branching to execute the corresponding statements 

SELECT @DatabaseName =  DB_NAME()
SELECT @ServerName = @@Servername 


Neil


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>