Generate Definition and Data

With this screen you can create a definition of a table in sql instructions and statements. It also creates the necessary Insert – Update statements based on the records present in the chosen table. As an example I will take a table 'Address' from the AdventureWorks database.

 

Generate Definition and Data: selecties en opties

Option / SelectionMeaningAction
SirkelData Generate Definition and Data - Table SelectionYou can choose a table with schema from a list of all tables in the database. 
SirkelData Generate Definition and Data - File SelectionHere you have the option to create or select a file. 
This creates a structured SQL statement.DROP TABLE Person
...
CREATE TABLE [Person].[Person]
...
Choice between Insert or Update statement.

INSERT INTO ...

UPDATE...

Choice if you want to keep a counter.

SET @InsertCnt = @InsertCnt + 1

SET @UpdateCnt = @UpdateCnt + 1

Check whether record exists or not.SELECT @count = COUNT(*) FROM [Person.Person] WHERE ...
IF @count = 0
Start and end for each statement either an Insert or an Update.BEGIN
END
 SET IDENTITY_INSERT Person.Person ...
 See the example below.

Generate Definition and Data: results

After the selection and the chosen parameters, the result is available in the internal text editor.