s

mssql select into multiple variables edit button Edit

author
Murugan Andezuthu Dharmaratnam | calendar 28 November 2020 | 1700

MSSQL how to select into multiple variables in mssql select statement. Or how to assign values to two or more variables using a single statement

Solution

select @variable1 = col1, @variable2 = col2
from table