Is it possible to specify TableNames, ColumnNames as stored procedure parameters for be used in a SQL statement.
I have heard the sysname data type could be used, but could not get that working.
The only way I can think of solving this problem is:
declare @strSQL varchar(8000)
set @strSQL ='select ' + @ColumnName + ' from ' + @TableName
EXEC (@strSQL)
does anybody have another solution?
thank you.
the