Home Forums SQL Server 2008 SQL Server 2008 - General how can I use a sproc @param as column alias? RE: how can I use a sproc @param as column alias?
ScottPletcher
SSC Guru
Points: 100952
More actions
September 29, 2016 at 12:48 pm
#1904022
Sample dynamic SQL:
DECLARE @MySprocParam VARCHAR(50) = 'TestAlias'
EXEC('SELECT ''ASDF'' AS [' + @MySprocParam + ']')
SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.