Ver originalDECLARE @query VARCHAR(MAX) SET @query='select campo1 from tabla where ' + @variable + '=campo' sp_executesql @query