????????????????????????????????????????

?????????????????????Σ??????д1???????д0.?????????????????м???????ж???????????0???????0?????????????????????????????μ??????????????????????????????磬???????д?????1??????????????????ж????????????????

??????????????????SQL Server?н????????????????????е???????????????????????????????????????????????????????????????????????????????????????????SQL Server??????????????????????????????????????????????′ε??????????ν????????????????????????

?????????????·???????????洢?????

create proc PROC_FindTemptable
/*
    * ????????????????????????????
????* ??????out???????0????????????????out???????1??
????* ??connection?????????????????SQL Server???????
????* ?緢????????????????????????????????tempdb?У???????????????
????* ??object_id??????ж?????????????.
*/
@View_userID char(20)??--???????  ????????
@outResult int out --????????? 0????е?? 1??????????
as
declare @View_sql varchar(100)
--object_id?????ж????????????????е?????
if OBJECT_ID ('tempdb.dbo.##'+@View_userID )is null
begin
--?????????
set @View_sql ='create table ##'+@View_userid+'(userid char(20))'
exec(@View_sql)
--out?????????0???????е????
set @outResult =0
end
--??????
else
--out?????1
set @outResult =1
--??????????У????????????????????????????????????????????????????????out???????0??????????????out???????1??
--????????ó????е???ù?????????????out?????1??????????????????????????message????????”??????????????????”

?????????е???洢?????????????????????????????????????д洢????д??????????У????????????ü????

 Public Function ExecuteProcTestID(ByVal strID As String?? ByVal strProc As String) As Integer
        Dim myConnection As New SqlConnection(CmdString) '????????
        Dim Cmd As New SqlCommand  '???SQL???????????
        '??????????洢?????????????cmd
        Cmd.Connection = myConnection
        '?????洢????
        Cmd.CommandType = CommandType.StoredProcedure
        Cmd.CommandText = strProc

        Cmd.Parameters.Add("@View_userID"?? SqlDbType.VarChar?? 20).Value = strID
        Cmd.Parameters.Add("@outResult"?? SqlDbType.VarChar?? 20).Direction = ParameterDirection.Output

        Try
            '??д洢????
            Cmd.ExecuteNonQuery()
            Return Cmd.Parameters(1).Value()
        Catch e As Exception
            Return False
        End Try
    End Function