select-asp 檔案轉換php實現,主要是SQLSERVER裡的預存程序轉換成mysql語句寫不出來!

來源:互聯網
上載者:User
關鍵字 select php
selectphp

=================預存程序=======================
ALTER PROCEDURE [dbo].[CreatUser]
-- Add the parameters for the stored procedure here
@Username varchar(50),
@userPassword varchar(50),
@QQID varchar(11),
@nResult int output
AS
BEGIN
declare @Qid int
set @Qid=null
select @Qid=id from [user] where qusername=@Username
if @Qid is not null
begin
set @nResult=-1
Goto theEnd
end
INSERT INTO [qqmsg].[dbo].user
select @QQID,@Username,@userPassword
set @nResult=0

theEnd:
SET NOCOUNT ON;
END

-- =============================================
-- Author: Liushuming
-- Create date: today
-- Description: for some usage
-- =============================================
ALTER PROCEDURE [dbo].[insertFriendGroup]
-- Add the parameters for the stored procedure here
@GroupName varchar(50),
@Ownerqid varchar(11),
@Groupid int output
AS
BEGIN
declare @Qid int
set @Qid=null
select @Qid=id from [user] where qid=@Ownerqid
if @Qid is null
set @Groupid=-1
else
begin
set @Qid =null
select @Qid=id from [qqmsg].[dbo].[FriendQIDFolder] where [ownerQid]=@Ownerqid and [FolderName]=@GroupName
if @Qid is null
begin
INSERT INTO [qqmsg].[dbo].FriendQIDFolder
select @Ownerqid,@GroupName
select top 1 @Groupid=id from [FriendQIDFolder] where
[ownerQid]=@Ownerqid and [FolderName]=@GroupName
end
else
set @Groupid=-2

endSET NOCOUNT ON;

END
====================asp檔案==================
dim Username,userPassword,QQID
Username=request("Username"):Username=Checkstr(Username)
userPassword=request("userPassword"):userPassword=Checkstr(userPassword)
QQID=request("QQID"):QQID=Checkstr(QQID)
Username=trim(Username):userPassword=trim(userPassword):QQID=trim(QQID)
if Username="" or userPassword="" or QQID="" then
response.write "err"
else
call StoreData()
end if
call CloseConn()
sub StoreData()
on error resume next
Dim Cmd
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection=conn
cmd.CommandText="[CreatUser]"
cmd.CommandType=4

    cmd.Parameters.Append cmd.CreateParameter("@Username",201,1,50)            cmd.Parameters.Append cmd.CreateParameter("@userPassword",201,1,50)            cmd.Parameters.Append cmd.CreateParameter("@QQID",201,1,11)    cmd.Parameters.Append cmd.CreateParameter("@nResult",3,2,4)    cmd("@Username")=Username    cmd("@userPassword")=userPassword    cmd("@QQID")=QQID    Cmd.Execute

if err then
response.write "err"&err.description
else
response.write Cmd("@nResult")
end if
end sub

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.