Saturday, September 17, 2016

Get the name of the server in T-SQL!

IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL DROP TABLE #TempTable
SELECT @@ServerName AS 'ServerName' INTO #TempTable
SELECT ServerName FROM #TempTable

No comments:

Post a Comment