Uday2
02-28-2008, 09:38 PM
Hi Erik,
I am a beginner to MySQL.
I have to convert few MS SQL Stored procedures to MySQL as we are converting the DB to MySQL.
One of my Stored Procedure to be converted to MySQL is as follows:
CREATE PROCEDURE dpr_ApplyNetLock
@LockType int,
@uuid char(50),
@SeatLimit int,
@appid int,
@ComputerName char(80),
@username char(80)
AS
declare @rows int
if @lockType = 16
begin
insert into BPNETMLock (Entry_Type, Unique_ID, ComputerName, UserName,
ApplicationType, ProcessID, login_time) select @LockType, @uuid, @ComputerName,
@username, @appid, @@spid, login_time from master..sysprocesses where spid = @@spid and
(select count(*) from BPNETMLock where Entry_Type = @LockType and
ApplicationType = @appid ) < @SeatLimit
select @rows = @@ROWCOUNT
if @rows = 0 return 1000
return 1
end
return 1000
GO
Can someone please help me in converting this. I have a few more to convert but if someone can help me with the above one I would try for the other.
Thank you so much in advance.
Regards,
Uday
I am a beginner to MySQL.
I have to convert few MS SQL Stored procedures to MySQL as we are converting the DB to MySQL.
One of my Stored Procedure to be converted to MySQL is as follows:
CREATE PROCEDURE dpr_ApplyNetLock
@LockType int,
@uuid char(50),
@SeatLimit int,
@appid int,
@ComputerName char(80),
@username char(80)
AS
declare @rows int
if @lockType = 16
begin
insert into BPNETMLock (Entry_Type, Unique_ID, ComputerName, UserName,
ApplicationType, ProcessID, login_time) select @LockType, @uuid, @ComputerName,
@username, @appid, @@spid, login_time from master..sysprocesses where spid = @@spid and
(select count(*) from BPNETMLock where Entry_Type = @LockType and
ApplicationType = @appid ) < @SeatLimit
select @rows = @@ROWCOUNT
if @rows = 0 return 1000
return 1
end
return 1000
GO
Can someone please help me in converting this. I have a few more to convert but if someone can help me with the above one I would try for the other.
Thank you so much in advance.
Regards,
Uday