-- Instal as a temp stored proc on any SQL edition RAISERROR ('Wrong database context. Please USE [master] to allow sp_generate_merge to be installed as a system ...
This system stored procedure takes a table name as a parameter and generates a MERGE statement containing all the table data. This is useful if you need to migrate static data between databases, eg.