How do I store the select column in a variable?
I tried this, but it throws me an error "Incorrect syntax":
declare @EmpId int SELECT dbo.Employ
Assuming such a query would return a single row, you could use either
select @EmpId = Id from dbo.Employee
Or
set @EmpId = (select Id from dbo.Employee)