SqlSerever System Defined PROCEDURE and Global Variable

Posted by dhirenkaunar-15094 under Sql Server category on | Points: 40 | Views : 1136
System Defind Stored Procedure
--List out ALL Database
exec sp_helpdb
-- returning description of table like DESC operator in Oracle
exec sp_help 'movie'
-- List out datafile and logfile information
exec sp_helpdb 'master'

Global Variables
select * from Course
select @@IDENTITY -- Returns Current identity column value of the session
select @@DATEFIRST -- Returns current date
select @@LANGUAGE -- Current SqlServer language 'us_english
select @@MAX_CONNECTIONS -- Returns maximum possible number of connection
select @@ERROR -- Returns iformation of recent T-sql error message
select @@VERSION -- Retunrs sql server version
select @@SERVERNAME -- returns servername
select @@ROWCOUNT -- Return number of rows retun or affected by previous query
select @@SERVICENAME -- Retunrs the service name

Comments or Responses

Login to post response