Give an Example of Set clause.

 Posted by vishalneeraj-24503 on 12/15/2014 | Category: Sql Server Interview questions | Views: 547 | Points: 40
Answer:

Variable Level:-
declare @date datetime;

set @date = getdate();
print @date;


Column level :-
Update table_name set col_name1 = 'val1',col_name2 = 'val2' where condition;

For Example:-
Update employee_master set modified_date = @date where employee_id = 1;


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response