@cmd = N'select @col1 from dbo.testtable'
I am not sure if this correct and would need to test but if you give it a try I would think something like this may work
@cmd = N'select ' + @col1 + 'from dbo.testtable'
The other way is which may work is
declare @SQLString AS VARCHAR(max)
set @SQLString = 'select ' + @col1 + 'from dbo.testtable'
@cmd = @SQLString
My home server is done when I get into my office I will give this a try
I am a Senior Data Analyst/DBA
I work with MS SQL, Oracle & several ETL Tools@thewolf66