I get an error in the query below. Why ?
DECLARE @Vr varchar(50);
SET @Vr = N'Infos';
IF @Vr = FAR
UPDATE MyTable
SET TAR = @Vr
Error - Invalid column name 'FAR'.
I am using the right database and right table. Then, why does this happen ?
My logic is if Column Far = variable Vr, then update Column TAR.
IF @Vr = FAR UPDATE MyTable SET TAR = @VrtoUPDATE MyTable SET TAR = @Vr WHERE FAR = @Vr.