Using stored procedure numeric type values in ASP

Source: Internet
Author: User
Tags documentation integer numeric sql ole variable
Stored Procedures
Using stored procedures in ASP

To improve the efficiency of ASP programs, it is sometimes necessary to use SQL Server storage technology in ASP, which is briefly described below.

Establishment of stored procedures

Here is a brief description of how to establish a stored procedure in SQL Server Enterprise Manager:

(1) Open Enterprise Manager Enterprise Manager

(2) Select the server groups (SQL Server group), servers, databases (database), and the database of the Stored, right-click the corresponding database under the Procdures item, in the pop-up menu select New Stored Procedure, In Stored Procedures properties, enter the statement that establishes the stored procedure. Here is an example:


CREATE PROCEDURE proctest @mycola char (@mycolb char), @mycolc text as

Insert into Chatdata (MYCOLA,MYCOLB,MYCOLC) VALUES (@mycola, @mycolb, @mycolc)

In SQL Server's document, its syntax is:

CREATE proc[edure] procedure_name [; number] [

{@parameter Data_type} [Varying] [= default] [OUTPUT]]

[,... N] [With {RECOMPILE | Encryption

| RECOMPILE, encryption}] [for REPLICATION] as

Sql_statement [... n]

If you are unfamiliar with SQL syntax, you can use check syntax to check the syntax. In the example above, represents a stored procedure named Mycola with 3 parameters, where the first parameter mycola the data type is char, Width 10, the 2nd parameter data type is char, the width is 10, and the 3rd parameter data type is text, where SQL is used The data type of the server.

After a stored procedure is established, the following is how to invoke the stored procedure in an ASP program: Invoking a stored procedure in ASP to improve the efficiency of an ASP program, sometimes using the storage technology using SQL Server in ASP, the following is simply a statement p with the add parameter above. Append cm. CreateParameter ("@mycolc", 201,1,250) in the format:

P.append cm. CreateParameter ("Parameter name", type, direction, size)

The meaning of the type of the parameter value is as follows:

Name Value integer value function


adDBTimeStamp 135 Date-time data type

Addecimal 140 Feed integer value

addouble 5 Double Precision Decimal value

Aderror 10 System error message

ADGUID 72 domain-wide unique identifier (globally unique identifier)

Addispath 9 Com/ole Automatic objects (Automation object)

Adinteger 3 4-byte signed integer

adIUnknown Com/ole Object

Adlongvarbinary 205 Large 2-byte value

adLongVarChar 201 Large String value

adLongVarWChar 203 Large encoded string

Adnumeric 1310 Feed Integer value

Adsingle 4 single-precision Floating-point decimal

adSmallInt 2 2-byte signed integer

Adtinyint 16 1-byte signed integer

Adunsignedbigint 21 8-byte unsigned integer

Adunsignedint 19 4-byte unsigned integer

Adunsignedsmallint 18 2-byte unsigned integer

Adunsignedtinyint 17 1-byte unsigned integer

Aduserdefined 132 user-defined data types

Advariant OLE Object

Advarbinary 204 double-byte Character Variable value

adVarChar 200 Character Variable value

adVarChar 202 not encoded string variable value

Adwchar 130 not encoded string


The meaning of the direction value is as follows:


Name Value integer value function


adParamInput 1 allows data to be entered into this parameter

adParamOutput 2 allows data to be exported to this parameter

adParamInputOutput 3 allows data input and output to this parameter

adParamReturnValue 4 allows you to return data from one subroutine to this parameter

For more detailed resources, refer to the documentation for SQL Server and the documentation resources for IIS.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.