Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO MyTable (
- Col1
- ,Col2 )
- OUTPUT DISTINCT -- issue is with DISTINCT
- INSERTED.Col1
- ,@otherParameter
- INTO IdListTable
- SELECT ColA
- ,ColB
- ,SUM(ImportantNumber)
- FROM MyOtherTable
- GROUP BY ColA, ColB
- INSERT INTO MyTable (
- Col1,
- Col2 )
- OUTPUT
- INSERTED.Col1,
- @otherParameter
- INTO #tempIdListTable
- SELECT ColA,
- ColB,
- SUM(ImportantNumber)
- FROM MyOtherTable
- GROUP BY ColA, ColB
- Insert into IdListTable
- Select distinct col1, col2 from #tempIdListTable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement