Problem: I have two tables and I want to retrieve one value from Estatus
table like:
var @status = SELECT ID FROM [adm].[Estatus] WHERE Nombre = 'ACTIVA'
and then insert it into another table like:
INSERT INTO [adm].[Users]
VALUES ('pepe@gmail.com', + @status + 'new')
but I get error into var @status
Incorrect syntax near '@status'
I try to use DECLARE
instead var but it doesn't work too
What do I need to get value and the use it in my insert query? Regards