I have a situation similar to the following:
--Set up some variables with values
DECLARE @V1 varchar(10)
SET @V1 = 'A'
DECLARE @V2 varchar(10)
SET @V2 = 'B'
DECLARE @V2 varchar(10)
SET @V3 = 'C'
DECLARE @VName varchar(10)
SET @VName = '@V1'
--WHERE @VName is set to the name of one of the variables
I now want to get the value of the variable referred to by @VName.
This will save me a ton of work if I can figure out how to make this happen.
Thanks for any insight you might be able to provide.
--Set up some variables with values
DECLARE @V1 varchar(10)
SET @V1 = 'A'
DECLARE @V2 varchar(10)
SET @V2 = 'B'
DECLARE @V2 varchar(10)
SET @V3 = 'C'
DECLARE @VName varchar(10)
SET @VName = '@V1'
--WHERE @VName is set to the name of one of the variables
I now want to get the value of the variable referred to by @VName.
This will save me a ton of work if I can figure out how to make this happen.
Thanks for any insight you might be able to provide.