What is the difference between a local and a global variable?

Answer Posted / thiyagaraj.ramaswamy

Local Variable :
The scope or lifetime of the local variable
is with in a block or procedure..
Eg: DECLARE @Variable1

Global Variable :
The scope or lifetime of the global
variable throughout the execution of the program..
Eg: DECLARE @@Variable1

Is This Answer Correct ?    119 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what stored procedure can you use to display the current processes? : Sql server administration

718


What are indexes in sql?

769


What is scd (slowly changing dimension)? : sql server analysis services, ssas

761


Difference between LEN() and DATALENGTH() in sql server ?

799


Name some of the open source software that you can use in alternative to SSR?

134






A trigger can reference objects outside the current database? State true or false.

745


Tell me about pre-defined functions of sql?

859


Is it possible to update the views? If yes, how, if not, why?

705


How to get the definition of a trigger back?

733


Can you pass expressions to stored procedure parameters?

704


How to provide values to user defined function parameters?

758


Explain the difference between functions and stored procedures in sql server?

676


what is normalization? : Sql server database administration

741


If any stored procedure is encrypted, then can we see its definition in activity monitor?

728


how you can get the list of largest tables in a database? : Sql server administration

725