SET and SELECT in SQL Server
3. Third difference can be found when the query returns more than one value. In this case , SET would return an error. For instance,the following code: Declare @Year_of_PassOut int SET @Year_of_PassOut= (SELECT Year_of_PassOut FROM ..) Would return the error- Msg 512, Level 16, State 1, Line 2 Subquery returned more than 1 value. This is not permitted…
read more