Currently, sp_generate_merge is installed as a system stored procedure. Installing into master DB in this way means that sysadmin privileges are required to create the sproc. The only other option was to install into an individual database, but even this requires db_owner role membership (or more precisely, CREATE PROC permission within the DB).
This PR makes it possible to install sp_generate_merge as a temporary proc, making it possible for anyone with read access to use the proc in their environment.
To generate merge statements via a temporary proc:
Edit sp_generate_merge.sql, replacing all occurrences of sp_generate_merge with #sp_generate_merge
Connect to the database that you want to use the proc within i.e. USE [AdventureWorks]
Execute the script
Generate merge statements as follows: EXEC [#sp_generate_merge] @Schema='Person', @Table_Name='AddressType'
Currently,
sp_generate_merge
is installed as a system stored procedure. Installing intomaster
DB in this way means that sysadmin privileges are required to create the sproc. The only other option was to install into an individual database, but even this requiresdb_owner
role membership (or more precisely,CREATE PROC
permission within the DB).This PR makes it possible to install
sp_generate_merge
as a temporary proc, making it possible for anyone with read access to use the proc in their environment.To generate merge statements via a temporary proc:
sp_generate_merge.sql
, replacing all occurrences ofsp_generate_merge
with#sp_generate_merge
USE [AdventureWorks]
EXEC [#sp_generate_merge] @Schema='Person', @Table_Name='AddressType'