Home > DeveloperSection > Interviews > Difference between Set and Select

Posted on    December-13-2010 12:00 AM

 MSSQL Server MSSQL Server 
Ratings:
 1 Answer(s)
  1381  View(s)
Rate this:

Amit Singh

Total Post:565

Points:2825
Posted on    December-13-2010 1:00 AM

Difference between Set and Select

  1. Set is a ANSI standard for variable assignment.
  2. Select is a Non-ANSI standard when assigning variables.

  1. We can assign only one variable at a time
  2. We can assign multiple variable at a time

  1. When assigning from a query that returns more than one value, SET will fail with an error.
  2. When assigning from a query that returns more than one value, SELECT will assign the last value returned by the query and hide the fact that the query returned


Don't want to miss updates? Please click the below button!

Follow MindStick