This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions. See the Microsoft® Developer Network for more information.
You can check a single database or multiple databases for allocation or consistency errors.
To check a database
Select the Databases node in the Object Explorer.
Complete the fields as necessary. Specify options for each selected object individually. Review the following for additional information:
No index | Select True to exclude nonclustered indexes for user tables from the check operation. |
Physical only | Select True to ensure that only physical integrity check are performed, that reduce the overall operation's duration. |
Set single user mode |
Select True to set single user mode, otherwise multi-user mode is on. Note: Single user mode is required for any type of repair. |
To generate DDL scripts
Select Tools | Export | Generate DDL Script.
Select one or more database from the list and click OK.
Check the object types and select the required objects in Search Results pane.
Tips:
Use to set searching options.
You can search not only by date or object type or name (or part of it), but you can also specify a name (or part of it) of the higher level object to which the search object should belong to. To perform complex name search split the object name by dots and select Search in Name (split by dots) option.
For example, you may find all columns named col1 belonging to the tables, that have "s" in their names - test.col1, sales.col1, etc.
Click at the upper right corner of the pane to open the Selected Objects pane.
The Selected Objects pane displays the list of objects selected for the DDL generation, while the Search Results pane displays your current search results.
For example, assume you search for tables and select three tables to add to the DDL generation. The tables are listed in the Selected Objects pane. When you perform another search, the previous table search disappears but the three selected tables remain in the Selected Objects pane.
If you do not enable the Selected Objects pane, you can only select objects in the current Search Results to add to the script generation. You cannot select objects from multiple searches.
To delete the object from the Selected Objects pane, click .
Select to set Export DDL options.
Complete the fields as necessary. Review the following for additional information:
Script options |
Description |
Drops |
Select True to add a DROP statement for any objects included in the SQL script. Caution: This drops existing objects in the database before the CREATE statement using the existing definition is generated. |
Script permissions |
Select True to create all permissions for existing objects included in the script. |
Table script options |
Description |
Script indexes |
Select True to create indexes that currently exist for tables. |
Script triggers |
Select True to create triggers that currently exist for tables. |
Script keys, defaults, check constraints |
Select True to create keys, defaults, and check constraints that currently exist for tables. |
Note: You can create Profiles to store your preset options.
Select to specify Output.
To set data script options
Select the Databases node in the Object Explorer.
Click Add, and select tables to include in the script.
Select the Options page.
Complete the fields as necessary. Review the following for additional information:
Table scripting options |
Description |
Script tables |
Select True to create a script for the existing tables. |
Script dependent objects |
Select True to create a script for dependent rules, defaults, user-defined datatypes, and user-defined functions. |
Script indexes |
Select True to create indexes that currently exist for tables. |
Script full-text indexes |
Select True to create full text indexes. |
Script triggers |
Select True to create triggers that currently exist for tables. |
Script keys, defaults, check constraints |
Select True to create keys, defaults, and check constraints that currently exist for tables. |
Data scripting options |
Description |
Disable triggers |
Select True to disable all triggers for a table before filling data. |
Disable constraints |
Select True to disable all constraints for a table before filling data. |
Delete data from the table |
Select True to delete all data in the current table before filling data. |
Use transactions |
Select True to use transaction statements for INSERT statements. |
Number of records for one transaction |
Select the number of INSERTs to create for each transaction The default is 0, which includes all INSERT statements in one transaction. |
Formatting |
Description |
Include headers |
Select True to include a comment for each table in the script. |
Use "use" keyword |
Select True to add the keyword "use" when separating tables in different databases. |
© ALL RIGHTS RESERVED. 이용 약관 개인정보 보호정책 Cookie Preference Center