---
title: "Difference between Set and Select"  
description: "Difference between Set and Select"  
author: "Amit Singh"  
published: 2010-12-13  
updated: 2020-09-22  
canonical: https://www.mindstick.com/interview/296/difference-between-set-and-select  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# Difference between Set and Select

**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

## Answers

### Answer by Amit Singh

**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


---

Original Source: https://www.mindstick.com/interview/296/difference-between-set-and-select

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
