在Asp中使用儲存過程 數值型別值

2021-03-31 08:56:31 字數 2006 閱讀 7760

在asp中使用儲存過程

為了提高asp程式的效率,有時需要在asp中使用使用sql server的儲存技術,下面簡單作乙個介紹。

儲存過程的建立

這裡只簡單介紹如何在sql server的企業管理器中如何建立儲存過程:

(1)開啟企業管理器enterprise manager

(2)選擇伺服器組(sql server group)、伺服器、資料庫(database)以及相就的資料庫,滑鼠右擊對應資料庫下的stored procdures項,在彈出的選單中選擇new stored procedure,在stored procedures properties中輸入建立儲存過程的語句。下面是乙個例子:

create procedure proctest @mycola char(10),@mycolb char(10),@mycolc text  as

insert into chatdata (mycola,mycolb,mycolc) values(@mycola,@mycolb,@mycolc)

在sql server的文件中它的語法為:

create proc[edure] procedure_name [;number]   [

[varying] [= default] [output]   ]

[,...n]  [with      ]  [for replication]  as

sql_statement [...n]

如果你對sql語法不熟悉,可以使用check syntax來檢查語法。在上例中,表示建立儲存過程名為mycola,帶3個引數的儲存過過程,其中第乙個引數mycola資料型別為char,寬度10;第2個引數資料型別為char,寬度為10,第3個引數資料型別為text,在這裡使用的是sql server的資料型別。

名稱值 整數值 功能

addbtimestamp 135 日期時間資料型別

addecimal 14 十進位制整數值

addouble 5 雙精度小數值

aderror 10 系統錯誤資訊

adguid 72 全域性唯一識別字(globally unique identifier)

addispath 9 ***/ole自動物件(automation object)

adinteger 3 4位元組有符號整數

adiunknown 13 ***/ole物件

adlongvarbinary 205 大型2位元組值

adlongvarchar 201 大型字串值

adlongvarwchar 203 大型未編碼字串

adnumeric 131 十進位制整數值

adsingle 4 單精度浮點小數

ad**allint 2 2位元組有符號整數

adtinyint 16 1位元組有符號整數

adunsignedbigint 21 8位元組無符號整數

adunsignedint 19 4位元組無符號整數

adunsigned**allint 18 2位元組無符號整數

adunsignedtinyint 17 1位元組無符號整數

aduserdefined 132 使用者自定義資料型別

advariant 12 ole物件

advarbinary 204 雙位元組字元變數值

advarchar 200 字元變數值

advarchar 202 未編碼字串變數值

adwchar 130 未編碼字串

方向值的意義如下:

名稱值 整數值 功能

adparaminput 1 允許資料輸入至該引數當中

adparamoutput 2 允許資料輸出至該引數當中

adparaminputoutput 3 允許資料輸入、輸出至該引數當中

adparamreturnvalue 4 允許從一子程式中返回資料至該引數當中

更多詳細資源請參考sql server的文件和iis的文件資源。

在Asp中使用儲存過程 數值型別值

在asp中使用儲存過程 為了提高asp程式的效率,有時需要在asp中使用使用sql server的儲存技術,下面簡單作乙個介紹。儲存過程的建立 這裡只簡單介紹如何在sql server的企業管理器中如何建立儲存過程 開啟企業管理器enterprise manager 選擇伺服器組 sql serve...

在ASP中使用儲存過程

學習使用儲存過程 stored procedure 是asp程式設計師的必須課之一。所有的大型資料庫都支援儲存過程,比如oracle ms sql等,但ms access不支援,不過,在access裡可以使用引數化的查詢 使用儲存過程有許多好處,它可以封裝複雜的資料邏輯,充分發揮大型資料庫本身的優勢...

在ASP中使用儲存過程

學習使用儲存過程 stored procedure 是asp程式設計師的必須課之一。所有的大型資料庫都支援儲存過程,比如oracle ms sql等,但ms access不支援,不過,在access裡可以使用引數化的查詢 使用儲存過程有許多好處,它可以封裝複雜的資料邏輯,充分發揮大型資料庫本身的優勢...