cookieChoices = {};

Wednesday, 4 May 2016

Get Session Id of current user process

Get Session Id of current user process


SELECT @@SPID AS 'Session_Id'  

Get name of register key under which SQL Server is running

Get name of register key under which SQL Server is running


SELECT @@SERVICENAME AS 'Service_Name'  

Return Server Name of SQL Server

Return Server Name of SQL Server

SELECT @@SERVERNAME AS 'Server_Name'

Get precision level used by decimal and numeric as current set in Server

Get precision level used by decimal and numeric as current set in Server

SELECT @@MAX_PRECISION AS 'MAX_PRECISION' 

Get Current Language Id

Get Current Language Id


SELECT @@LANGID AS 'Language ID' 

Disable all constraints of all tables

Disable all constraints of all tables


EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'  

Disable all constraints of a table

Disable all constraints of a table

ALTER TABLE Table_Name NOCHECK CONSTRAINT ALL