generate_inserts
generate_inserts copied to clipboard
Generate SQL Insert Statements from your existing data
this is the output i get ``` Msg 537, Level 16, State 2, Procedure sp_generate_inserts, Line 333 [Batch Start Line 0] Invalid length parameter passed to the LEFT or SUBSTRING...
WHEN @Data_Type IN ('char','varchar','nchar','nvarchar') -> WHEN @Data_Type IN ('char','varchar','nchar','nvarchar','date') currently dates generate unquoted which sql server will not convert to date (could also cast or convert to date but believe...
…s/content by leveraging varchar(max), reformatted code with datagrip @lambacck thanks for fixing other bugs, I've further improved the store proc to support the date type and I've added a fix...
- FIX: made @column_List and @Actual_Values of type varchar(max) as suggested - ADD: new Parameter @whereClause allowing you to select only part of a table for exporting, e.g. EXEC sp_generate_inserts...
If a table has many columns and lengthy column names, the generated select statement can be incomplete due to truncation . This leads to unpredictable errors or potentially invalid results....