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

Microsoft SQL Server 2005 Developer’s Guide- P3 docx

10 213 0

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

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 431,07 KB

Nội dung

Overall, the new features in SQL Server 2005 give it a very high return on investment. Features like web services provide better connectivity to customers, paving the way to improved profitability. Likewise, XML integration enables better integration with business partners for improved profitability. Additionally, the inclusion of the .NET Framework, improved management tools, and Report Services empower employees, enabling them to be more productive. A Brief History of Microsoft SQL Server SQL Server 2005 is the latest version of a database server product that has been evolving since the late 1980s. Microsoft SQL Server originated as Sybase SQL Server in 1987. In 1988, Microsoft, Sybase, and Aston-Tate ported the product to OS/2. Later, Aston-Tate dropped out of the SQL Server development picture, and Microsoft and Sybase signed a co-development agreement to port SQL Server to Windows NT. The co-development effort cumulated in the release of SQL Server 4.0 for Windows NT. After the 4.0 release, Microsoft and Sybase split on the development of SQL Server; Microsoft continued forward with future releases targeted for the Windows NT platform while Sybase moved ahead with releases targeted for the UNIX platform, which they still market today. SQL Server 6.0 was the first release of SQL Server that was developed entirely by Microsoft. In 1996, Microsoft updated SQL Server with the 6.5 release. After a two-year development cycle, Microsoft released the vastly updated SQL Server 7.0 release in 1998. SQL Server 7.0 embodied many radical changes in the underlying storage and database engine technology used in SQL Server. SQL Server 2000, the accumulation of another two-year development effort, was released in September of 2000. The move from SQL Server 7.0 to SQL Server 2000 was more of an evolutionary move that didn’t entail the same kinds of massive changes that were made in the move from 6.5 to 7.0. Instead, SQL Server 2000 built incrementally on the new code base that was established in the 7.0 release. Starting with SQL Server 2000, Microsoft began releasing updates to the basic release of SQL Server in the following year starting with XML for SQL Server Web Release 1, which added several XML features including the ability to receive a result set as an XML document. The next year they renamed the web release to the more succinctly titled SQLXML 2.0, which, among other things, added the ability to update the SQL Server database using XML updategrams. This was quickly followed by the SQLXML 3.0 web release, which included the ability to expose stored procedures as web services. Two years later, Microsoft SQL Server release history cumulates with the release of SQL Server 2005. SQL Server 2005 uses the same basic architecture that was established with SQL Server 7 and it adds to this Introduction xix xx Microsoft SQL Server 2005 Developer’s Guide all the features introduced with SQL Server 2000 and its web releases in conjunction with the integration of the .NET CLR and an array of powerful new BI functions. The following timeline summarizes the development history of SQL Server: ᭤ 1987 Sybase releases SQL Server for UNIX. ᭤ 1988 Microsoft, Sybase, and Aston-Tate port SQL Server to OS/2. ᭤ 1989 Microsoft, Sybase, and Aston-Tate release SQL Server 1.0 for OS/2. ᭤ 1990 SQL Server 1.1 is released with support for Windows 3.0 clients. ᭤ Aston-Tate drops out of SQL Server development. ᭤ 1991 Microsoft and IBM end joint development of OS/2. ᭤ 1992 Microsoft SQL Server 4.2 for 16-bit OS/2 1.3 is released. ᭤ 1992 Microsoft and Sybase port SQL Server to Windows NT. ᭤ 1993 Windows NT 3.1 is released. ᭤ 1993 Microsoft and Sybase release version 4.2 of SQL Server for Windows NT. ᭤ 1994 Microsoft and Sybase co-development of SQL Server offi cially ends. ᭤ Microsoft continues to develop the Windows version of SQL Server. ᭤ Sybase continues to develop the UNIX version of SQL Server. ᭤ 1995 Microsoft releases version 6.0 of SQL Server. ᭤ 1996 Microsoft releases version 6.5 of SQL Server. ᭤ 1998 Microsoft releases version 7.0 of SQL Server. ᭤ 2000 Microsoft releases SQL Server 2000. ᭤ 2001 Microsoft releases XML for SQL Server Web Release 1 (download). ᭤ 2002 Microsoft releases SQLXML 2.0 (renamed from XML for SQL Server). ᭤ 2002 Microsoft releases SQLXML 3.0. ᭤ 2005 Microsoft releases SQL Server 2005 on November 7 th , 2005. 1 CHAPTER 1 The Development Environment IN THIS CHAPTER SQL Server Management Studio BI Development Studio Copyright © 2006 by The McGraw-Hill Companies. Click here for terms of use. 2 Microsoft SQL Server 2005 Developer’s Guide W hen it comes to server management, a lot has changed for the DBA in SQL Server 2005. The administrative tools that were used to manage the previous versions of SQL Server have been replaced, and new management tools have been added to help the DBA interact more efficiently with the database server. In this chapter, we’ll first take a look at the new SQL Server Management Studio, which combines, into one integrated environment, the four previous tools: Enterprise Manager, Query Analyzer, Profiler, and Analysis Manager. While each of these tools allowed the DBA to perform their specific tasks, switching between the tools and remembering different interfaces and syntax could create unneeded headaches. By having one management environment, the DBA can focus on managing the server objects more efficiently. The second part of this chapter will explore the new Business Intelligence (BI) Development Studio. The BI Development Studio is an integrated development environment used to create Analysis Services databases, DTS packages, and Reporting Services reports. You can organize components into projects and solutions in the BI Development Studio in a disconnected mode, and then deploy the solutions at a later time. SQL Server Management Studio The SQL Server Enterprise Manager, which was the primary management tool for SQL Server versions 7 and 2000, has been replaced by the new SQL Server Management Studio, which also replaces the Query Analyzer tool, which was the core T-SQL development tool in SQL Server versions 7 and 2000. SQL Server 2005 also includes several other administrative tools, such as the new Administration Console, the Database Tuning Adviser, and the Profiler. The SQL Server Management Studio is accessed using the Start | Programs | Microsoft SQL Server | SQL Server Management Studio menu option. You can see the SQL Server Management Studio in Figure 1-1. The SQL Server Management Studio can be used to manage SQL Server 2005 systems as well as SQL Server 2000 and SQL Server 7 systems; however, it cannot be used on SQL Server 6.5 or older systems. You can use the previous SQL Server 7/2000 Enterprise Manager to manage a new SQL Server 2005 system, but this isn’t supported or recommended because of some architectural changes between the two releases. Likewise, the older management tools cannot access any of the new features that have been added to SQL Server 2005. The SQL Server Management Studio is the best choice for managing mixed SQL Server 2005 and SQL Server 7/2000 systems. The SQL Server Management Studio has been completely rewritten and now uses the latest Microsoft technologies, like Winforms and the .NET Framework. Chapter 1: The Development Environment 3 This allows you to write, edit, run, and debug code, and it supports the creation of solution projects. It is also integrated with Visual SourceSafe for source code version control. It doesn’t allow you to compile VB.NET, C#, J#, or VC++, like the Visual Studio 2005 development environment; instead, SQL Server Management Studio works with T-SQL, MDX, and DTS. The SQL Server Management Studio User Interface One of the important improvements the SQL Server Management Studio offers over the SQL Server Enterprise Manager lies in its use of dialog boxes. The displayed dialog boxes are now nonmodal, which means that you are not required to respond to the dialog before you can do anything else. In the older SQL Server Enterprise, if you opened a dialog, you couldn’t do anything else until the dialog was closed. The new nonmodal dialogs used by the SQL Server Management Studio solve this Figure 1-1 SQL Server Management Studio 4 Microsoft SQL Server 2005 Developer’s Guide problem and make it possible for the DBA to perform other management tasks while one of the dialogs is displayed. Another important enhancement in the SQL Server Management Studio is how it deals with large numbers of database objects. In the previous versions of SQL Server, the SQL Server Enterprise Manager always enumerated all of the database objects when it connected to a registered server. This wasn’t a problem for most small and medium-sized businesses, as their databases tended to be smaller in size. However, for companies with very large databases, which could contain thousands of database objects, the SQL Server Enterprise Manager could take a very long time listing all of the database objects and their properties. This basically left the SQL Server Enterprise Manager unusable until all of the objects were listed. With SQL Server 2005, the SQL Server Management Studio loads objects asynchronously, allowing the user to start to expand a database item that has many children, while at the same time performing other activities in the user interface. SQL Server Management Studio User Interface Windows This section gives you an overview of the SQL Server Management Studio user interface windows, including: ᭤ The Registered Servers window ᭤ The Object Explorer window ᭤ The Solutions Explorer window ᭤ The Properties window ᭤ The Query Editor window ᭤ The Results window Registered Servers As with the previous SQL Server Enterprise Manager, you must register servers in the SQL Server Management Studio before you can use it to manage them. To register new SQL Server systems, you use the SQL Server Management Studio’s Registered Servers window (shown in the upper left-hand corner of Figure 1-1). You can also use the Registered Servers window to group common servers together into logical server groups. You can connect to and manage any SQL Server component using the SQL Server Management Studio, including instances of the Database Engine, Analysis Services, Reporting Services, Integration Services, and SQL Server Mobile Edition. Chapter 1: The Development Environment 5 You register a new SQL Server system in the Registered Servers window by right- clicking the window and selecting the New | Server Registration option from the context menu. Likewise, you can create a new server group by right-clicking in the Registered Servers window and selecting the New | Server Group option from the context menu. The Registered Servers window also allows you to export or import registered servers information. This enables you to quickly populate the Registered Servers windows of other SQL Server Management Studios without having to manually reregister all of the managed servers. Object Explorer The Object Explorer window of SQL Server Management Studio allows you to connect to any of the SQL Server components. The Object Explorer window, shown in the lower left-hand corner of Figure 1-1, provides a tree-structured folder view of all the objects in the server and displays a user interface to manage the objects. The folders displayed under each server connection type are specific to the functions of the server. Table 1-1 describes the server types and their respective main folders. The first thing you need to do in order to use Object Explorer is connect to a server type. You click the Connect button on the Object Explorer toolbar and choose the type of server from the drop-down list, which opens the Connect To Server dialog box as shown in Figure 1-2. You must provide at least the name of the server and the correct authentication information to connect to the server. You can optionally specify additional connections in the Connect To Server dialog, and the dialog will retain the last used settings. To work with the objects that are displayed in the Object Explorer, you right-click the desired object in the Object Explorer tree to display the object’s context menu. The context menu provides a unique set of options for each of the different objects. For instance, the SQL Server | Databases folder displays a context menu that allows you to create, attach, back up, restore, copy, and generate scripts for a database; while the SQL Server | Databases | Tables | table context menu allows you to create, modify, open, rename, delete, or generate a script; to define a full-text index; and to view dependencies for a table. Generating Scripts A very useful enhancement in SQL Server Management Studio is the ability to generate scripts for database objects. You can create scripts using Object Explorer or by using the Generate SQL Server Scripts Wizard. Object Explorer allows you to easily create scripts for an entire database, or for a single database object. You have the option of creating the script in a Query Editor window, to a file, or to the clipboard. The types of scripting options presented are dependent on the type of database object you choose to script. For example, if you 6 Microsoft SQL Server 2005 Developer’s Guide Server Type Main Folder Description SQL Server Databases This folder contains the System Databases folder, the Database Snapshots folder, and any User Database folders. The objects that are contained in each database are in their own folders and include tables and views, synonyms, stored procedures, functions, triggers, assemblies, types, rules, defaults, users, roles, schemas, and symmetric keys. Security This folder contains the Logins, Server Roles, Linked Servers, and Credential folders. The objects in these folders are available to the entire server, not just to a single database. DTS 2000 Packages Folder for SQL Server 2000 DTS migration packages. Notification Services You can start an instance of Notification Services that allows you to perform maintenance tasks and update notification applications in your environment, including: managing and monitoring security and permissions; starting and stopping instances and applications; backing up of application databases and definitions; updating application features; and moving, upgrading, or deleting instances of Notification Services. Replication This folder contains information about Replication publications and subscriptions. Management This folder contains the SQL Server Logs, Backup Devices, Server Triggers, and Maintenance Plans folders. It also has the Activity Monitor, SQL Mail, and Database Mail nodes. Support Services This folder contains a tool for monitoring the Distributed Transaction Coordinator and Full-Text Search. SQL Server Agent This folder contains the Jobs, Alerts, Operators, Proxies, and SQL Agent Error Logs folders. The SQL Server Agent is displayed only to members of the sysadmin role. Analysis Server Databases This folder contains the SQL Server 2005 Analysis Services (SSAS) databases. You can manage existing databases; create new roles and database assemblies; and process cubes, dimensions, and mining structures. Assemblies This folder contains the server assemblies information. Integration Services Running Packages This folder contains the opened and running SQL Server 2005 Integration Services (SSIS) packages. Stored Packages This folder contains links to all the SSIS packages stored in the file system or in the msdb database. Report Server You can manage one or more report servers in a workspace. The report servers are denoted as a node in the object hierarchy structure. SQL Server Mobile This folder contains a limited set of SQL Server nodes that includes: Tables, Views, Programmability, and Replication. Table 1-1 Server Types Chapter 1: The Development Environment 7 choose to script an entire database, the CREATE and DROP scripting options are available. However, if you choose to script a view, the CREATE and DROP scripting options are available, as well as ALTER, SELECT, INSERT, UPDATE, and DELETE. To script an object using Object Explorer, right-click the object and then select Script <object type> as an option from the context menu. The Generate Scripts Wizard can be used and will walk you through the process of creating scripts. The wizard allows you to select a variety of objects to be scripted at once instead of selecting each object individually. It contains a variety of options for generating scripts, including permissions, collation, and constraints. The wizard is useful when you need to create scripts for a large number of objects. There are two ways to launch the Generate Scripts Wizard. The first way to open the Generate Scripts Wizard is by right-clicking an instance of a SQL Server Database Engine and selecting the Launch Wizard option. Then select the Generate Scripts option from the next context menu displayed. The second way is to expand the Databases folder in Object Explorer and right-click a database. Select the Tasks option from the context menu, and then select Generate Scripts. The Summary screen of the Generate Scripts Wizard is shown in Figure 1-3. Summary Pages When you select an item in Object Explorer, information about that object is presented in a document window called the Summary Page. You can configure the SQL Server Management Studio to display the Summary Page automatically, or you can disable the display of the Summary Page. To configure the display option for the Summary Page, click the Tools | Options option from the Management Studio menu. On the Environment/General page, select Open Object Explorer from the At Startup drop-down box to display the Summary Page when Figure 1-2 The Connect To Server dialog box 8 Microsoft SQL Server 2005 Developer’s Guide SQL Server Management Studio opens. Any other choice from the drop-down box will set the Summary Page to not be displayed automatically. The Summary Page displays information about the currently selected object of the Object Explorer window. The Summary Page for the columns of a table in a database can be seen in Figure 1-4. Solution Explorer The Solution Explorer is an important management tool that is provided as a part of the SQL Server Management Studio. You can see the Solution Explorer in the upper right-hand corner of Figure 1-1. The Solution Explorer is used to provide a hierarchical tree view of the different projects and files in a solution. A solution Figure 1-3 Generate Scripts Wizard . History of Microsoft SQL Server SQL Server 2005 is the latest version of a database server product that has been evolving since the late 1980s. Microsoft SQL Server originated as Sybase SQL Server. version of SQL Server. ᭤ 1995 Microsoft releases version 6.0 of SQL Server. ᭤ 1996 Microsoft releases version 6.5 of SQL Server. ᭤ 1998 Microsoft releases version 7.0 of SQL Server. ᭤ 2000 Microsoft. that have been added to SQL Server 2005. The SQL Server Management Studio is the best choice for managing mixed SQL Server 2005 and SQL Server 7/2000 systems. The SQL Server Management Studio

Ngày đăng: 05/07/2014, 05:20