I have a SubQuestionScoreLink
table that links a SubQuestion
with all available Score
options that will appear in a dropdown on the web site. As you can see from the example below currently 7 Scores
are used per SubQuestion
. I've created a new Score
in the database that has an Id of 8.
How would I go about creating a SQL script that will insert a new record per SubQuestion
. I could achieve this in C# easily but think that's overkill.
Is the process something like the following:
SubQuestion
IdsSubQuestion
Ids INSERT INTO [dbo].[SubQuestionScoreLink]
([SubQuestionId]
,[ScoreId]
,[SortOrder])
VALUES (@CurrentSubQuestionId ,8 ,0)
How would I do this as a SQL script?
INSERT INTO [dbo].[SubQuestionScoreLink] ([SubQuestionId] ,[ScoreId] ,[SortOrder])
SELECT DISTINCT SubQuestionId, 8, 0
FROM table