【正文】
d retrieval object(often stored procedure), appropriate indexes, and security.Designing the database so that your application use hardware optimally and allows for future grows, identifying and modeling database objects and application logic, and specifying the types of information for each object and type of relationship.Administering the application after deployment, which includes configuring servers and clients, monitoring server performance, managing jobs, alerts, and operators, managing security, and managing database backup procedures. Procedures to Stored ProceduresThis section introduces the different types of stored procedures, describes how stored procedures are processed, both initially and on subsequent execution, and lists some of the advantages of using stored procedures. Stored ProceduresA stored procedure is a named collection of TransactSQL statements that is stored on the server. Stored procedures are a method of encapsulating repetitive tasks that executes efficiently. Stored procedures support userdeclared variables, conditional execution, and other powerful programming features. Microsoft SQL Server version supports five types of stored procedures:System Stored Procedures (sp_) Stored in the master database, system stores procedures (identified by type sp_prefix) provide an effective method to retrieve information from system tables. They allow system administration tasks that update system tables even though the administrators do not have permission to update the underlying tables directly. System stored procedures can be executed in any database.Local Stored Procedures Local stored procedures are created in individual user databases.Temporary Stored Procedures Temporary stored procedures can be local, with names that start with a double pound symbol () ——local temporary stored procedures are available within a single user session。t have parameters, then it really doesn39。 So why should we create and use a stored procedure instead of just creating a SQLexecution of the procedure faster. Stored procedures are often cached by the database, thus making them fastert, but SQL Server does. You can make your data a little bit more secure by specifying that your databaseboth a recordset and other values. As a general rule, stored procedures will nearly always通信體系結(jié)構(gòu)中的組件包括:應(yīng)用程序、數(shù)據(jù)庫接、網(wǎng)絡(luò)庫、 客戶機(jī)和服務(wù)器可以同時(shí)使用多個(gè)NetLibrary,但是為了成功通信,它們必須使用一個(gè)公共的網(wǎng)絡(luò)庫。開放數(shù)據(jù)服務(wù) 這是一個(gè)SQL Server組件,處理網(wǎng)絡(luò)連接,把客戶的請(qǐng)求傳給SQL Server進(jìn)行處理,并把任何結(jié)果和應(yīng)答返回給SQL Server客戶。 應(yīng)用程序編程接口數(shù)據(jù)庫API定義如何寫一個(gè)應(yīng)用程序連接到數(shù)據(jù)庫,和把命令傳遞給數(shù)據(jù)庫。OLE DB可以訪問SQL Server,其他關(guān)系數(shù)據(jù)庫和其他數(shù)據(jù)源中的數(shù)據(jù)。ActiveX數(shù)據(jù)對(duì)象(ADO) ActiveX數(shù)據(jù)對(duì)象(ADO)在一個(gè)簡化的數(shù)據(jù)模型中封裝OLE DB API,降低了應(yīng)用程序開發(fā)和維護(hù)的成本。在設(shè)計(jì)一個(gè)SQL Server應(yīng)用程序之前,花一些時(shí)間設(shè)計(jì)一個(gè)數(shù)據(jù)庫對(duì)業(yè)務(wù)對(duì)象準(zhǔn)確建模是很重要的。可以把軟件應(yīng)用程序分為3個(gè)邏輯層,他們可以位于一個(gè)或多個(gè)服務(wù)器上。但是,服務(wù)器會(huì)變成一個(gè)瓶頸,因?yàn)閿?shù)據(jù)庫和業(yè)務(wù)服務(wù)競(jìng)爭相同的硬件資源。使用Microsoft Access這樣的產(chǎn)品為小單位開發(fā)的應(yīng)用程序是這種設(shè)計(jì)的一個(gè)例子。多層企業(yè)應(yīng)用程序和使用事務(wù)處理監(jiān)視程序開發(fā)的應(yīng)用程序是這種設(shè)計(jì)的一個(gè)例子。 Server數(shù)據(jù)庫實(shí)現(xiàn)一個(gè)SQL Server數(shù)據(jù)庫意味著計(jì)劃,創(chuàng)建和維護(hù)一些相互關(guān)聯(lián)的組件。設(shè)計(jì)數(shù)據(jù)庫。包括表、數(shù)據(jù)庫完整性機(jī)制、數(shù)據(jù)輸入和獲取對(duì)象(常常是存儲(chǔ)過程)、合適的索引、和安全策略。正確的數(shù)據(jù)庫設(shè)計(jì)、索引的的正確使用、RAID和文件組,它們的組合對(duì)于獲得好的性能是必需的。存儲(chǔ)過程是SQL語句的命名集合,存放在服務(wù)器上。(3)臨時(shí)存儲(chǔ)過程臨時(shí)存儲(chǔ)過程可以是局部的,名字前有一個(gè)磅符(#),也可以是全局的,名字前有兩個(gè)磅符(##);局部臨時(shí)存儲(chǔ)過程在單個(gè)用戶會(huì)話中可用,全局臨時(shí)存儲(chǔ)過程在所有會(huì)話中都可用。 進(jìn)而,請(qǐng)求將不依賴于它從其中訪問數(shù)據(jù)的任何DBMS。ODBC被設(shè)計(jì)用于能允許使用相同源代碼通過單一請(qǐng)求訪問不同數(shù)據(jù)庫管理系統(tǒng)的最大限度聯(lián)機(jī)操作。Command對(duì)象特定地為處理各種類型的命令而設(shè)計(jì),特別是那些需要參數(shù)的命令。存儲(chǔ)過程(有時(shí)也稱存儲(chǔ)查詢)是存儲(chǔ)在數(shù)據(jù)庫中預(yù)先定義的SQL查詢語句。并非所有的數(shù)據(jù)庫都支持這種緩存機(jī)制,比如微軟的Access 就不支持,而SQL Server卻支持。? 可以將所有SQL代碼集中存放于服務(wù)器。