Cum fixezi "Account Aleardy Connected" bug?
Simplu... ruleaza urmatoarele 2 Scripturi in SQL Query analyzer.
si acest Script
Daca ati rulat aceste doua scripturi trebe sa va mearga perfect! :^_^:
Simplu... ruleaza urmatoarele 2 Scripturi in SQL Query analyzer.
- Cod:
CREATE PROCEDURE WZ_CONNECT_MEMB
@uid varchar(10),
@server varchar(15),
@uip varchar(15)
AS
Begin
BEGIN TRANSACTION
SET NOCOUNT ON
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
UPDATE MEMB_STAT
SET IP = @uip , ConnectStat = '1' , ServerName = @server , ConnectTM = (getdate())
WHERE memb___id = @uid
End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,ConnectStat,ServerName,IP, ConnectTM) values (
@uid,
'1',
@server,
@uip,
(getdate())
)
End
IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION
SET NOCOUNT OFF
End
GO
si acest Script
- Cod:
CREATE PROCEDURE WZ_DISCONNECT_MEMB
@uid varchar(10)
AS
Begin
BEGIN TRANSACTION
SET NOCOUNT ON
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
UPDATE MEMB_STAT
SET DisConnectTM = (getdate()), connectstat = '0' WHERE memb___id = @uid
End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,ConnectStat,DisConnectTM) values (
@uid,
0,
(getdate())
)
End
IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION
SET NOCOUNT OFF
End
GO
Daca ati rulat aceste doua scripturi trebe sa va mearga perfect! :^_^: