Skip to content

Instantly share code, notes, and snippets.

@ste-bel
Created May 1, 2021 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ste-bel/2d4b5f3f6cf434d7fe1ad172d408c233 to your computer and use it in GitHub Desktop.
Save ste-bel/2d4b5f3f6cf434d7fe1ad172d408c233 to your computer and use it in GitHub Desktop.
-- Show what has been found
SELECT * FROM @meta
ORDER BY [value_found], [schema_name], [table_name], [column_name], [update_script]
-- Merge update queries to use some of them in a customization project
SELECT DISTINCT STRING_AGG(CAST([update_script] AS nvarchar(max)), ';' + CHAR(13) + CHAR(10)) AS UpdateQueries
FROM @meta
-- Merge delete queries to use some of them in a customization project
SELECT DISTINCT STRING_AGG(CAST([delete_script] AS nvarchar(max)), ';' + CHAR(13) + CHAR(10)) AS DeleteQueries
FROM @meta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment