System variable and temporary variables



System variable and temporary variables..

Answer / Anusha Sachan

In SQL Server, system variables are predefined variables with a fixed name that provide information about the current state of the server or session. Temporary variables, on the other hand, are user-created variables with a scope limited to the current session or batch execution. Here are some examples:nnSystem Variables:n- @@SPID: returns the process ID of the current session.n- @@VERSION: returns the SQL Server version information.nnTemporary Variables:n- DECLARE @myVar INT; - declares a temporary integer variablen- SET @myVar = 10; - assigns a value to the temporary variable

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

write a query for list of owner who are having multiple bikes in below table 1 shanker pulsar 2 shanker Honda 3 shanker car 4 Balu pulsar 5 Balu Honda 6 Balu car 7 Shyam pulsar 8 Jaya Honda 9 Deepa car 10 vasu car

12 Answers   Cognizant, TCS,


if 3 duplicate records in a table,i want to delete 2 duplicate records by keeping 1 duplicate and 1 original as it is,how?

5 Answers  


What is indexing a document?

1 Answers  


You want to implement the one-to-many relationship while designing tables. How would you do it?

1 Answers  


Why we use functions in sql server?

1 Answers  


why would you call update statistics? : Sql server database administration

1 Answers  


What are statistics?

1 Answers  


What is database isolation in sql server? : sql server database administration

1 Answers  


What is cross join in sql server joins?

1 Answers  


How to create a local temporary stored procedure?

1 Answers  


How can you tell if a database object is invalid?

1 Answers   MCN Solutions,


I have a huge amount of data which is displayed in a report. The data is viewed every day. Every day the data is displayed in 30 secs but suddenly today it is giving an timeout message today. Data has not been changed. The situation is same as yesterday. What might be the reason??? Please Answer.

4 Answers   Satyam,


Categories