Tuesday, March 20, 2012

Can I convert/reference a string to a var?

hey, guys

I got a strange question. :)

In SQL Server,
declare @.Item8 as varchar(100)
declare @.str as varchar(100)
set @.str = '@.Item8'
Is there any way I can reference @.str to @.Item8 ?

Thanks

No. This is not possible. Variables are scoped to batch or module or dynamic SQL batch.

No comments:

Post a Comment