View defragment-identity-fk.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------- | |
-- Script to "defragment" identity values in tables of the current database | |
-- | |
-- Author: Sebastiaan Dammann | |
-- | |
-- Global overview: | |
-- This script generates SQL statements you can use to remove gaps in identity | |
-- values in your SQL database. This script only operates on the dbo schema. | |
-- You can exclude tables for defragmenting via @tablesToSkip (LIKE query pattern). | |
-- |