【正文】
據(jù)庫(kù)為中心的視點(diǎn)設(shè)計(jì)的團(tuán)體應(yīng)用程序是這種設(shè)計(jì)的一個(gè)例子。ODBC 這是一個(gè)調(diào)用級(jí)的接口,它直接訪問SQL Server TDS協(xié)議,并支持使用ODBC的數(shù)據(jù)對(duì)象接口寫的應(yīng)用程序或組件。be quicker than their equivalent SQL statements. To use a stored procedure you just put the name of the stored procedure as the mandt matter whether you use a Connection, a Command, or a Recordset. ProceduresThe use of stored procedures is the one area where the Command object es intoAdministering 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, but SQL Server does. You can make your data a little bit more secure by specifying that your database 應(yīng)用程序編程接口數(shù)據(jù)庫(kù)API定義如何寫一個(gè)應(yīng)用程序連接到數(shù)據(jù)庫(kù),和把命令傳遞給數(shù)據(jù)庫(kù)??梢园衍浖?yīng)用程序分為3個(gè)邏輯層,他們可以位于一個(gè)或多個(gè)服務(wù)器上。 Server數(shù)據(jù)庫(kù)實(shí)現(xiàn)一個(gè)SQL Server數(shù)據(jù)庫(kù)意味著計(jì)劃,創(chuàng)建和維護(hù)一些相互關(guān)聯(lián)的組件。ODBC被設(shè)計(jì)用于能允許使用相同源代碼通過單一請(qǐng)求訪問不同數(shù)據(jù)庫(kù)管理系統(tǒng)的最大限度聯(lián)機(jī)操作。? 可以將所有SQL代碼集中存放于服務(wù)器。存儲(chǔ)過程(有時(shí)也稱存儲(chǔ)查詢)是存儲(chǔ)在數(shù)據(jù)庫(kù)中預(yù)先定義的SQL查詢語(yǔ)句。(3)臨時(shí)存儲(chǔ)過程臨時(shí)存儲(chǔ)過程可以是局部的,名字前有一個(gè)磅符(#),也可以是全局的,名字前有兩個(gè)磅符(##);局部臨時(shí)存儲(chǔ)過程在單個(gè)用戶會(huì)話中可用,全局臨時(shí)存儲(chǔ)過程在所有會(huì)話中都可用。包括表、數(shù)據(jù)庫(kù)完整性機(jī)制、數(shù)據(jù)輸入和獲取對(duì)象(常常是存儲(chǔ)過程)、合適的索引、和安全策略。使用Microsoft Access這樣的產(chǎn)品為小單位開發(fā)的應(yīng)用程序是這種設(shè)計(jì)的一個(gè)例子。ActiveX數(shù)據(jù)對(duì)象(ADO) ActiveX數(shù)據(jù)對(duì)象(ADO)在一個(gè)簡(jiǎn)化的數(shù)據(jù)模型中封裝OLE DB API,降低了應(yīng)用程序開發(fā)和維護(hù)的成本。通信體系結(jié)構(gòu)中的組件包括:應(yīng)用程序、數(shù)據(jù)庫(kù)接、網(wǎng)絡(luò)庫(kù)、 客戶機(jī)和服務(wù)器可以同時(shí)使用多個(gè)NetLibrary,但是為了成功通信,它們必須使用一個(gè)公共的網(wǎng)絡(luò)庫(kù)。 So why should we create and use a stored procedure instead of just creating a SQLCreating the database and database objects, including tables, data integrity mechanisms, data entry and retrieval object(often stored procedure), appropriate indexes, and security.to run, as they don39。開放數(shù)據(jù)服務(wù)自動(dòng)監(jiān)聽在服務(wù)器上安裝的所有服務(wù)器網(wǎng)絡(luò)庫(kù)。一個(gè)很好設(shè)計(jì)的數(shù)據(jù)庫(kù)要求極少的更改通常更有效的執(zhí)行。Internet 處理分為3層,業(yè)務(wù)和表示服務(wù)位于Web服務(wù)器上,客戶機(jī)使用簡(jiǎn)單的瀏覽器。 應(yīng)用程序的用戶能增加請(qǐng)求驅(qū)動(dòng)程序的軟件組成部分,此驅(qū)動(dòng)程序是請(qǐng)求和具體的DBMS之間的接口。? 通過指定數(shù)據(jù)庫(kù)中的表只能被存儲(chǔ)過程修改,可以確保數(shù)據(jù)更安全。? 存儲(chǔ)過程通常被數(shù)據(jù)庫(kù)高速緩存,這樣使它們運(yùn)行得更快,因?yàn)榇藭r(shí)不需從磁盤中讀取它們。 ODBC接口許可最大限度連機(jī)操作—任一應(yīng)用程序都能在不同的的DBMS(數(shù)據(jù)庫(kù)管理系統(tǒng))中通過一個(gè)單一的接口訪問數(shù)據(jù)。設(shè)計(jì)數(shù)據(jù)庫(kù)時(shí),要保證數(shù)據(jù)庫(kù)正確迅速的執(zhí)行重要的功能。但是,復(fù)雜的可能性增加,且這個(gè)方法對(duì)小型應(yīng)用程序較慢。 SQL Server Server應(yīng)用程序計(jì)劃一個(gè)數(shù)據(jù)庫(kù)設(shè)計(jì)要求想建模的業(yè)務(wù)對(duì)象的知識(shí),和用于表示這些業(yè)務(wù)功能的數(shù)據(jù)庫(kù)概念及特性。TDS包封裝在為網(wǎng)絡(luò)庫(kù)使用的協(xié)議