SELECT *
FROM [Live].[Test]
WHERE [_fk_RoadMapKey] = @_fk_RoadMapKey
SELECT @TestKey = [TestKey]
FROM [Live].[Test]
WHERE [_fk_RoadMapKey] = @_fk_RoadMapKey
SELECT *
FROM [Live].[SetofTestGrades]
WHERE [_fk_TestKey] = @TestKey
最初の 2 つのステートメントで、testkey を割り当てると同時にすべての test を取得できますか?
SELECT * ,@TestKey = [TestKey] FROM [Live].[Test]
WHERE [_fk_RoadMapKey] = @_fk_RoadMapKey