CREATE proc Testn
AS
declare @TmpRs table(ID decimal)
insert into @TmpRs select ID from cus
Select * from @TmpRs
go
-----------------------------
--调用
exec testn
drop proc testn
---------------------
/*
ID
1
2
3
4
5
6
7
*/
AS
declare @TmpRs table(ID decimal)
insert into @TmpRs select ID from cus
Select * from @TmpRs
go
-----------------------------
--调用
exec testn
drop proc testn
---------------------
/*
ID
1
2
3
4
5
6
7
*/
RETURNS @CheckStat Table(
ID int identity(1,1),
TypeID int,
PlaceID int,
AreaID int)
Dim Rs As New ADODB.Recordset
cmd.ActiveConnection = g_DB 'g_DB 是一个全局连接Connection对象,已经打开
cmd.CommandText = "TEST"
cmd.CommandType = adCmdStoredProc
Set Rs = cmd.Execute
MsgBox Rs.RecordCount '这里出错,提示:对象关闭...
'如果我在存储过程中不对表变量进行insert into 操作,Rs.RecordCount可以正常返回为0
i