Useful Query

Analyze query slowness
Use this query to see what all is running on the DB and see where you might have lock conflicts SELECT SESSION_ID, START_TIME, BLOCKING_SESSION_ID,...
Wed, Nov 27, 2024 2:07 PM
SQL ChangeTracking
--Setup DB for ChangeTracking ALTER DATABASE [DatabaseName] SET CHANGE_TRACKING = ON (CHANGE_RETENTION = 7 DAYS, AUTO_CLEANUP = ON); --Set Table ChangeTr...
Wed, Nov 27, 2024 4:04 PM
Product to Holding
SELECT ProdI.[MdmId] AS ProductItemMdmId ,ProdI.[Name] ,ProdI.[Upc] ,ProdI.[BrandId] ,ProdI.[Active] ,C.[MdmId] AS CountryMdmI...
Wed, Nov 27, 2024 4:08 PM
Stores with Hierarchy Info
SELECT SA.[MdmStoreId] , H.[Name] AS Holding , D.[Name] AS Division , B.[Name] AS Banner , SB.[Name] AS SubBanner FROM [StoreAssociation] SA ...
Wed, Nov 27, 2024 4:09 PM