Wednesday

delete all duplicates in TSQL but one

     

WITH a as
(
SELECT PeriodId
,StationId
,WeekDay
,WeekCycle
,ProductId
,AssignedDate
,MenuId
,ROW_NUMBER() OVER(PARTITION by PeriodId
                        ,StationId
                        ,WeekDay
                        ,WeekCycle
                        ,ProductId
                        ,AssignedDate
                        ,MenuId ORDER BY PrimawebMenuId desc ) AS duplicateRecCount
FROM MenuProducts
)
--Deleting Duplicate Records
DELETE FROM a
WHERE duplicateRecCount > 1
    

No comments:

here is powershell script on how to get list of files from changesets associated with one tfs task

$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...