DECLARE @sql VARCHAR(100) DECLARE @pk INT SET @pk = 2 SET @sql = 'SELECT id, pcname FROM pod WHERE id = ' + CAST(@pk AS VARCHAR) EXEC (@sql) -- or -- EXEC sp_sqlexec @SQL
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)