Reputation: 8225
I am trying to perform insert query from one specific column from a table plus two static values, I am trying something like this:
INSERT INTO TableA(PolicyId, Type, Used)
SELECT ID FROM Policies, 'A', 1
But I am getting error near 'A' per SSMSE. How can I tackle this task?
Upvotes: 3
Views: 3640
Reputation: 91608
You'll need to put these static values in your SELECT
clause:
INSERT INTO TableA(PolicyId, Type, Used) SELECT ID, 'A', 1 FROM Policies
Upvotes: 7