Hi, I'm currently getting error in the following code for 'interestName'. It doesn't like me using it in the Insert statement. Do I need to select into a @variable? What's the syntax like? Thank you.
Msg 128, Level 15, State 1, Procedure GetData, Line 85
The name "interestName" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
SELECT dbo.ResearchInterests.Name as interestName, dbo.ResearchInterests.ParentResearchInterest_id as parentId
WHERE dbo.ResearchInterests.Id = @interestChildId
INSERT INTO [CtsiMembershipProduction].[dbo].[Interest]