Articles → SQL SERVER → Variables in SQL Server

Variables in SQL Server







DECLARE @variable_name data_type




DECLARE @row_count INT





Setting values








SET 
  @variable_name = val




SET 
  @errormessage = 'Invalid User'






SELECT 
  @variable_name = [column_Name | Aggregate function] 
FROM 
  table_name




SELECT 
  @row_count = count(*) 
FROM 
  user_information



Posted By  -  Karan Gupta
 
Posted On  -  Saturday, April 2, 2011

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250