ADO中sqlserver存储过程使用

作者:袖梨 2022-06-30
从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)

相关文章

精彩推荐