Newbee SQL question, how do I set a variable = field name? getting Msg 207 error on the Set line below.
When I use an integer, say 26, instead of the field name "Production " I do not have an error.
Code:
declare @TempProduction as int, @TempTimeStamp as date, @TempQuality as int, @TempMachineName as varchar(50) select Production, TimeStamp1, Quality, MachineName, @TempProduction From dbo.testwide where MachineName = 'a' set @TempProduction = Production -- @TempTimeStamp = TimeStamp1, -- @TempQuality = Quality, -- @TempMachineName = MachineName --from dbo.testwide
Comment