ADO中sqlserver存储过程使用

类别:Asp 点击:0 评论:0 推荐:
从ADO中得到多个记录集以及怎么样在ADO中使用sql server 的存储过程 DataType Value Length Data Length BIGINT 996857543543543 15 8 INT 543543 6 4 SMALLINT 32765 5 2 TINYINT 254 3 1 BIT True 1 1 DECIMAL 765.5432321 11 9 NUMERIC 432.6544 8 5 MONEY 543.1234 6 8 SMALLMONEY 543.1234 6 4 FLOAT 5.4E+54 8 8 REAL 2.43E+24 9 4 DATETIME 8/31/2003 11:55:25 PM 19 8 SMALLDATETIME 8/31/2003 11:55:00 PM 19 4 CHAR QWE 3 4 VARCHAR Variable! 9 9 TEXT     307 NCHAR WIDE 4 8 NVARCHAR   0 0 NTEXT     614 GUID {58F94A80-B839-4B35-B73C-7F4B4D336C3C} 36 16
Return Value: 0

CREATE PROCEDURE "dbo"."DataTypeTester" @myBigInt bigint , @myInt int , @mySmallint smallint , @myTinyint tinyint , @myBit bit , @myDecimal decimal(10, 7) , @myNumeric numeric(7, 4) , @myMoney money , @mySmallMoney smallmoney , @myFloat float , @myReal real , @myDatetime datetime , @mySmallDatetime smalldatetime , @myChar char(4) , @myVarchar varchar(10) , @myText text , @myNChar nchar(4) , @myNVarchar nvarchar(10) , @myNText ntext , @myGuid uniqueidentifier AS SELECT 'BIGINT' "DataType", @myBigInt "Value" , LEN(@myBigInt) "Length" , DATALENGTH(@myBigInt) "Data Length" SELECT 'INT' , @myInt , LEN(@myInt) , DATALENGTH(@myInt) SELECT 'SMALLINT' , @mySmallint , LEN(@mySmallint) , DATALENGTH(@mySmallint) SELECT 'TINYINT' , @myTinyint , LEN(@myTinyint) , DATALENGTH(@myTinyint) SELECT 'BIT' , @myBit , LEN(@myBit) , DATALENGTH(@myBit) SELECT 'DECIMAL' , @myDecimal , LEN(@myDecimal) , DATALENGTH(@myDecimal) SELECT 'NUMERIC' , @myNumeric , LEN(@myNumeric) , DATALENGTH(@myNumeric) SELECT 'MONEY' , @myMoney , LEN(CAST(@mySmallMoney as varchar)) , DATALENGTH(@myMoney) SELECT 'SMALLMONEY' , @mySmallMoney , LEN(CAST(@mySmallMoney as varchar)) , DATALENGTH(@mySmallMoney) SELECT 'FLOAT' , @myFloat , LEN(@myFloat) , DATALENGTH(@myFloat) SELECT 'REAL' , @myReal , LEN(@myReal) , DATALENGTH(@myReal) SELECT 'DATETIME' , @myDatetime , LEN(@myDatetime) , DATALENGTH(@myDatetime) SELECT 'SMALLDATETIME' , @mySmallDatetime , LEN(@mySmallDatetime) , DATALENGTH(@mySmallDatetime) SELECT 'CHAR' , @myChar , LEN(@myChar) , DATALENGTH(@myChar) SELECT 'VARCHAR' , @myVarchar , LEN(@myVarchar) , DATALENGTH(@myVarchar) SELECT 'TEXT' , '' , '' , DATALENGTH(@myText) SELECT 'NCHAR' , @myNChar , LEN(@myNChar) , DATALENGTH(@myNChar) SELECT 'NVARCHAR' , @myNVarchar , LEN(@myNVarchar) , DATALENGTH(@myNVarchar) SELECT 'NTEXT' , '' , '' , DATALENGTH(@myNText) SELECT 'GUID' , @myGuid , LEN(@myGuid) , DATALENGTH(@myGuid) -- TODO: READTEXT should do this... /* , @myText "text" , @myNText "ntext" */ RETURN(0)
Code:

本文地址:http://com.8s8s.com/it/it9098.htm