MS SQL Basics Tutorial: An object's SQL script

Source: Internet
Author: User

Enterprise Manager provides a visual interface in which the database and its objects, such as tables, views, defaults, and so on, rarely require the user to edit their own program code. But it is good for users to understand how these objects are built through the SQL language and get their SQL language scripts (script). provides tools in enterprise Manager to help users generate SQL language scripts for these objects.

The SQL script method that generates the object is as follows:

(1) Select the object in Enterprise Manager to generate the SQL script, right-click, and choose Generate SQL Scripts menu item from the All Tasks submenu on the shortcut menu, and the dialog box shown in Figure 5-15 appears.

(2) When you set an option in the SQL Script Generation dialog box, clicking the "Preview" button pops up the preview dialog shown in Figure 5-16. You can click the "Copy" button to copy the script statement to the Clipboard. You can also select the "OK" button in Figure 5-15 to specify the script filename and location.

The SQL script generated by Enterprise Manager is a file with a suffix named ". sql", which is actually a text file, which can be browsed or modified in Enterprise Manager or another file editor. If necessary, you can generate SQL scripts for all database objects as a backup of the database. When the database is corrupted, you can run this SQL script in query Analyzer to rebuild the database.

See the full set of "MS SQL Basics Tutorials"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.