1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu môn SQL server 2000

54 180 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 54
Dung lượng 319 KB

Nội dung

Appendix SQL Server 2000 A reference of SQL Server Books Online Hoàng Hữu Việt IT Faculty, Vinh University Contents       Installation Authentication Modes SQL Server components Database Architecture SQL Server Enterprise Manager Query Analyzer Slide Install  To install Sql Server 2000    Insert the Microsoft® SQL Server™ 2000 compact disc in your CD-ROM drive If the compact disc does not autorun, double-click Autorun.exe in the root directory of the compact disc Select SQL Server 2000 Components Select Install Database Server and setup prepares the SQL Server Installation Wizard At the Welcome screen, click Next Slide Install  To install Sql Server 2000    In the Computer Name dialog box, Local Computer is the default option and the local computer name appears in the edit box Click Next In the Installation Selection dialog box, click Create a new instance of SQL Server, or install Client Tools, and then click Next Follow directions on the User Information, Software License Agreement and related screens Slide Install  To install Sql Server 2000   In the Installation Definition dialog box, click Server and Client Tools, and then click Next In the Instance Name dialog box, if the Default check box is available, you can install either the default or a named instance If the Default check box is not available, a default instance has already been installed, and you can install only a named instance  To install the default instance, select the Default check box, and click Next Slide Install  To install Sql Server 2000    In the Setup Type dialog box, click Typical or Minimum, and then click Next In the Service Accounts dialog box, click Local, and then click Next In the Authentication Mode dialog box, click Mixed Mode, enter password for sa user, and then click Next  For information about Authentication modes options, see Authentication Modes Slide Install  To install Sql Server 2000    When you are finished specifying options, click Next in the Start Copying Files dialog box In the Choose Licensing Mode dialog box, make selections according to your license agreement, and click Continue to begin the installation In the Setup Complete dialog box, click Yes, I want to restart my computer now, and then click Finish Slide Authentication Modes  Microsoft® SQL Server™ can operate in one of two security (authentication) modes:  Windows Authentication   Windows Authentication mode allows a user to connect through a Microsoft Windows NT® 4.0 or Windows® 2000 user account Mixed Mode  Mixed Mode allows users to connect to an instance of SQL Server using either Windows Authentication or SQL Server Authentication Users who connect through a Windows NT 4.0 or Windows 2000 user account can make use of trusted connections in either Windows Authentication Mode or Mixed Mode Slide Authentication Modes  Sql Server security Slide Starting SQL Server   Before you log in to an instance of Microsoft® SQL Server™, you need to start an instance of SQL Server To start Sql Server using the SQL Server Service    Right-click on Sql Server Icon in taskbar Click MSSQL Server - Start After starting the SQL Server service, users can establish new connections to the server Slide 10 Sql Server Enterprise Manager  To create a user    Expand a server group, and then expand a server Expand Security, click Logins, and then rightclick New Login In tab General   In Name, enter a name for the Microsoft® SQL Server™ login Under Authentication, select SQL Server Authentication Slide 40 Sql Server Enterprise Manager  To create a user  In tab General   In tab Server Roles   Set Server Roles In tab Database   Optionally, in Password, enter a password Specify which databases can be accessed by this login Click Ok button and confirm password Slide 41 Sql Server Enterprise Manager  To grant a user    Expand a server group, and then expand a server Expand Databases, and then expand the database to which the login will be granted access Right-click Users, and then click New Database User Slide 42 Sql Server Enterprise Manager  To grant a user    In the Login name box, click the Microsoft® SQL Server™ login to which database access will be granted Optionally, in User name, enter the user name that the login is known by in the database By default, it is set to the login name Optionally, select database role memberships in addition to public, the default Slide 43 Sql Server Enterprise Manager  To attach a database     Expand a server group, and then expand a server Right-click Databases, and select All Tasks, and then click Attach Database Enter the name of the MDF (master data file) of the database to attach If you are not sure where the file is located, click browse ( ) to search To ensure that the specified MDF file is correct, click Verify Slide 44 Sql Server Enterprise Manager  To attach a database    In the Attach as box, enter the name of the database The database name must not match any existing database names Specify the database owner Click OK A database node for the newly attached database is created in the Database folder Slide 45 Sql Server Enterprise Manager  To detach a database      Expand a server group, and then expand a server Expand Databases Right-click the database, and then select All Tasks/Detach Database To terminate any existing connections from the database, click Clear Click OK The database node for the detached database is removed from the Database folder Slide 46 Sql Server Enterprise Manager  To generate a script    Expand a server group, and then expand a server Expand Databases, right-click the database to script, point to All Tasks, and then click Generate SQL Scripts On the General tab, select the database objects to script By default, all objects in the database are scripted Slide 47 Sql Server Enterprise Manager  To generate a script  On the Formatting tab, select from the script formatting options:   Generate the CREATE command for each object so that each object to be scripted is explicitly created using its existing definition This is selected by default Generate the DROP command for each object so that a DROP statement is added to the script for each object to be scripted This is selected by default Slide 48 Sql Server Enterprise Manager  To generate a script  On the Formatting tab    Generate scripts for all dependent objects so that all objects in the database which are needed to create the objects listed in the script are included automatically in the script if not already selected On the Options tab, select the security-related, table-related, and script file-related options On the General tab, click Preview to view a preview of the generated script Slide 49 Query Analyzer  Microsoft® SQL Server™ 2000 SQL Query Analyzer is a graphical tool that allows you to:    Create queries and other SQL scripts and execute them against SQL Server databases Quickly insert, update, or delete rows in a table Locate objects within databases (object search feature), or view and work with objects Slide 50 Query Analyzer   Connect to an instance of SQL Server to open a query window in SQL Query Analyzer To connect to SQL Server  In the Connect to SQL Server dialog box, enter the name of the database server in the SQL Server box   To select the local server, select (local) To specify another server or another instance of the server, enter the server name in the SQL Server box Click the browse button ( ) to display a list of active servers Slide 51 Query Analyzer  To connect to SQL Server    Click Windows NT Authentication to connect using Windows NT Authentication Click SQL Server Authentication to connect using SQL Server Authentication Note: This dialog box is also accessible from the toolbar, and from the Connect command on the File menu Slide 52 Query Analyzer  Query Window   The title bar of the query window displays the name of the database server, the name of the current database, the current login name, and the query name The query window is composed of multiple panes    The Editor pane is a text editor where you can enter Transact-SQL statements The Results pane displays returned result sets The Messages pane displays error messages Slide 53 Query Analyzer  To work a database  To change a database   Click icon To execute SQL statements   Execute a complete script by creating or opening the script in the Editor pane and pressing F5 Execute only selected SQL statements by highlighting the lines of code in the Editor pane and pressing F5 Slide 54 [...].. .SQL Server Components  SQL Server Enterprise Manager  SQL Server Enterprise Manager is the primary administrative tool for SQL Server and provides an MMC-compliant user interface that allows users to:    Define groups of SQL Server instances Create and administer all SQL Server databases, objects, logins, users, and permissions in each registered server SQL Query Analyzer  SQL Query... (2,147,483,647) bytes Slide 28 Sql Server Enterprise Manager  To modify a table    Expand a server group, and then expand a server Expand Databases, expand the database in which the table belongs, and then click Tables In the details pane, right-click the table, and then click Design Table Slide 29 Sql Server Enterprise Manager  To open a table    Expand a server group, and then expand a server Expand Databases,... all other databases, including the location of the database files master records the initialization information for SQL Server; always have a recent backup of master available Slide 16 Sql Server Enterprise Manager  To create a database    Expand a server group, and then expand a server Right-click Databases, and then click New Database Enter a name for the new database  The primary database and... Architecture  Physical Database Files  SQL Server 2000 databases have three types of files:  Primary data files: This file contains the startup information for the database and is used to store data Every database has one primary data file The recommended file name extension for primary data files is mdf Slide 14 Database Architecture  Physical Database Files  SQL Server 2000 databases files (cont…)  ... All Rows Slide 30 Sql Server Enterprise Manager  To delete a table      Expand a server group, and then expand a server Expand Databases, expand the database in which the table belongs, and then click Tables In the details pane, right-click the table, and then click Delete To see how deleting this view will affect the database, click Show Dependencies Click Drop All Slide 31 Sql Server Enterprise... table      Expand a server group, and then expand a server Expand Databases, expand the database in which the table belongs, and then click Tables In the details pane, right-click the table, and then click Rename Enter the new name of the table Confirm the new name Slide 32 Sql Server Enterprise Manager  To create a view     Expand a server group, and then expand a server Expand Databases,... values in a database Slide 21 Sql Server Enterprise Manager  Database components   Users: A user identifier (ID) identifies a user within a database All permissions and ownership of objects in the database are controlled by the user account Roles: Roles are a powerful tool that allow you to collect users into a single unit against which you can apply permissions Slide 22 Sql Server Enterprise Manager... Enterprise Manager  To create a table     Expand a server group, and then expand a server Expand Databases, expand the database in which the table belongs, and then click Tables In the details pane, right-click and then click New Table Add the columns and other details of the table     Column Name Data type Length Allow Null Slide 23 Sql Server Enterprise Manager  Data types  Integers  ... from -10^38 +1 through 10^38 –1 Numeric: Functionally equivalent to decimal Slide 24 Sql Server Enterprise Manager  Data types  Float and Real    Float: Floating precision number data from -1.79E + 308 through 1.79E + 308 Real: Floating precision number data from -3.40E + 38 through 3.40E + 38 DateTime Slide 25 Sql Server Enterprise Manager  Data types  Character string    Char: Fixed-length... (2,147,483,647) characters Slide 26 Sql Server Enterprise Manager  Data types  Unicode character strings    Nchar: Fixed-length Unicode data with a maximum length of 4,000 characters Nvarchar: Variable-length Unicode data with a maximum length of 4,000 characters Ntext: Variable-length Unicode data with a maximum length of 2^30 - 1 (1,073,741,823) characters Slide 27 Sql Server Enterprise Manager  Data ... of Microsoft® SQL Server , you need to start an instance of SQL Server To start Sql Server using the SQL Server Service    Right-click on Sql Server Icon in taskbar Click MSSQL Server - Start... Authentication Modes SQL Server components Database Architecture SQL Server Enterprise Manager Query Analyzer Slide Install  To install Sql Server 2000    Insert the Microsoft® SQL Server 2000 compact... instance of SQL Server to open a query window in SQL Query Analyzer To connect to SQL Server  In the Connect to SQL Server dialog box, enter the name of the database server in the SQL Server box

Ngày đăng: 04/12/2015, 02:56

TỪ KHÓA LIÊN QUAN

w