About T-SQL and SQL Enterprise Manager, SQL Enterprise

Source: Internet
Author: User

About T-SQL and SQL Enterprise Manager, SQL Enterprise

After reading the database video, we often use two methods in the video. One is the SQL Enterprise Manager, and the other is the T-SQL (Tansact-SQL ). For the first method, it feels very simple. with corresponding icons, you can easily deal with each task. Is that enough? Obviously, this is not true. The two have their own merits.

Enterprise Manager is a graphical interface, which is a good tool for beginners. But to carry out professional development, it is best to know more about T-SQL is better. Professional DBAs seldom use the Enterprise Manager to manage databases. In the actual application process, you may need to remotely manage the library through non-graphical interface tools such as telnet, this time if you do not understand the T-SQL is not good. Although the Enterprise Manager provides a wealth of content, but a lot of functionality is not done with it, all need to be done with T-SQL.

The following describes some of the content in the video, which can be summarized in two ways.

1. Enterprise Manager Method Introduction

1. Create a database.

Open SQL Server, right-click "Database" in the object resource manager, and click "CREATE DATABASE. The following describes how to create a database named "company.



2. Modify the database. This includes how to narrow down database files and modify database structures.

In SQL Server, you can modify attributes to modify the size of database files. However, this method can only increase the database space, rather than reduce the size. To reduce the number, you still need to use the "contract" option.


Enter the size in the initial size box.

To modify the database structure, open the database attribute dialog box of the user database to modify the structure and modify the relevant content. Such as data files or transaction log files.


Here, I will change the automatic growth of database files to "increment to 10% without limiting growth"


3. Delete the database. This is especially simple.


You can also select to DELETE or press the DELETE key.

Next we will use another method (T-SQL) statement to summarize the above three operations.

2. Introduction of T-SQL Method

1. Create a database.

After the T-SQL statement is written, a database is created successfully.


2. Modify the database.

Take creating a database named employees as an example. Add a file group containing two data files and a transaction log file.


Write the T-SQL statement to see each file or file group contained in the database property.


3. Delete the database.

This statement is very simple. You only need to write Drop database database_name (database name ).

Note that before using Drop database to delete a database, you must consider the readonly option of the database as false. Otherwise, the database cannot be deleted.

This is to use two methods for different operations on database creation, modification, and deletion. As mentioned above, although using Enterprise Manager is simple, for a professional programmer, t-SQL statements are still very important.




For T-SQL and SQL Enterprise Manager

Enterprise Manager is a graphical interface, which is a good tool for beginners. But to carry out professional development, it is best to know more about T-SQL is better. Professional DBAs seldom use enterprise managers to manage databases. In the actual application process, you may need to remotely manage the database through non-graphical interface tools such as telnet, this time if you do not understand the T-SQL is not good. Although the Enterprise Manager provides a wealth of features, but there are a lot of functionality that can not be done with it, all need to be done with T-SQL.

What is the difference between using Enterprise Manager and using TSQL statements to create databases?

It can be used without any difference. Only TSQL statements are used to create databases in large databases to prevent database loss.

Related Article

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.