Script and data generation

Often it requires to make SQL scripts based data and properties of table. It may be necessary if you want to deploy tables from development environment to test or production environment, or to transfer data, or to adjust data.

Teide helps in preparation SQL expression.

It is possible to form SQL expressions with data, or to form template SQL expressions.

All expressions are written out to existing Query window. If no opened Query window, new Query window opens.

Select "Script and data generation" in left window (Operations).

- Create table: make expression of current table creation (Create table)

- Insert: make expression of add all records from current table (Insert). If you select some fields, only selected fields will be included in the statement.

Primary Keys and not null fields are not added automatically.

- Update: make expression of update all records from current table (Update). If you select some fields, only selected fields will be included into the statement. Selection of the statement is based on Primary key fields.

- Delete: make expression of delete records (Delete). Selection of the statement is based on Primary key fields.

- Select template: make template of selection statement (Select). This statement is valuable if you want to specify fields and list of fields in the table is significant. If you select some fields, only selected fields will be included into the statement.

- Insert template: make template of statement to add new records into the table (Insert). Two types of statements are made: 1) Insert values (insert into <table> (<fields>) values (<values>), 2) Insert from table (insert into <table> (<fields>) (select <fields>). If you select some fields, only selected fields will be included in the statement.

- Update template: make template of statement to adjust data in table (Update). If you select some fields, only these fields will be included in the statement.

- Delete template: make template of statement to delete data in table (Delete). If you select some fields, these fields will be included into selection condition (where expression).