sql-generate-insert
sql-generate-insert copied to clipboard
Added the ability to include or exclude specific columns.
Added two parameters allowing you to include or exclude columns by name.
Example
-- This ensures that ID, Name, and DateAdded are included but DateAdded, Date Changed, AddedByID, and ChangedByID are not.
-- If a row is included in both lists, it will be excluded.
EXECUTE dbo.GenerateInsert @ObjectName = N'dbo.MYTABLE', @ColumnExclusion = 'DATEADDED,DATECHANGED,ADDEDBYID,CHANGEDBYID', @COLUMNINCLUSION='ID,NAME,DATEADDED';