Does anyone knows how to solve this problem bellow ?
I dont know how to put variable in where condition in a dynamic sql command .
EDITED
I put autofipe ddl right here
SQL 2014 i am using
Thanks in advance
Does anyone knows how to solve this problem bellow ?
I dont know how to put variable in where condition in a dynamic sql command .
EDITED
I put autofipe ddl right here
SQL 2014 i am using
Thanks in advance
I believe this question has already been answered here: SQL Server - In clause with a declared variable [duplicate]
Also, I'm not expert in SQL, but it feels like you didn't assign a value to @cod_fipe before using it, shouldn't that be SET @cod_fipe = ...
instead of SELECT @cod_fipe = ...
?