Compare both
declare @test-2 varchar(10)
declare @field varchar(10)
SET @field = 'CustomerID'
Select @test-2 = @field from Customers WHERE (City = 'Berlin')
Print @test-2
this prints CustomerID (the field Name as such) Instead ALFKI.
---------------------------------
SELECT CustomerID FROM Customers WHERE (City = 'Berlin')
here my result is ALFKI.
I need the Same in the above.
Help Me.