Reputation: 1
I'm looking to understand how I can insert a hard coded value into a table during an insert of a specific pull of data. The code below should give an idea of what I am trying to do...It's basically grab a certain set of UserIDs and drop them into another Table and hardcode a value called 'Trial' into the column next to the UserID.
Is something like this easy/possible?
Insert Into LastSubscriptionWasTrial (UserId,**'HARDCODEVALUEHERE'**)
SELECT UserId
FROM ....(Pulling my list of UserIDs here)
Upvotes: 0
Views: 1683
Reputation: 247720
unless I am totally missing something from your question you should be able to do the following, you just have to put the value you want hard coded in your statement.
Insert Into LastSubscriptionWasTrial (UserId, TrialField)
SELECT UserId, 'Trial' FROM ....(Pulling my list of UserIDs here)
Upvotes: 0
Reputation: 55402
As originally written your INSERT
statement is missing its VALUES
specifier, so it's looking for a column name when it finds 'Trial'. It's unclear whether UserId is a column or a variable name so I can't suggest a correct statement.
Upvotes: 1