SQL???????????????????
???????????? ???????[ 2013/7/3 11:19:46 ] ????????
????????????????????????????????????????
?????????????????????Σ??????д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
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11