Question
April 30, 2008 at 04:13 AM
alexs

Indirect select of a local variable in MSSQL

by alexs . Updated 18 years, 4 months ago

Is it possible in MSSQL do select the value of a local variable indirectly:

DECLARE @A VARCHAR(10);
DECLARE @B VARCHAR(10);
DECLARE @C VARCHAR(10);
DECLARE @NAME VARCHAR(20);

SET @A = ‘Hello’;
SET @B = ‘to’;
SET @C = ‘World’;

SET @Name = ‘@B’;

SELECT the value of the local variable named by @Name!!!!

This discussion is locked

All Comments