Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- MEMB_STAT: ORIGINAL DA MINHA DB
- CREATE TABLE [dbo].[MEMB_STAT] (
- [memb___id] [varchar] (10) COLLATE Latin1_General_CS_AS NOT NULL ,
- [ConnectStat] [tinyint] NULL ,
- [ServerName] [varchar] (10) COLLATE Latin1_General_CI_AS NULL ,
- [IP] [varchar] (15) COLLATE Latin1_General_CI_AS NULL ,
- [ConnectTM] [smalldatetime] NULL ,
- [DisConnectTM] [smalldatetime] NULL ,
- [OnlineHours] [int] NOT NULL
- ) ON [PRIMARY]
- GO
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- WZ_DISCONNECT_MEMB: ORIGINAL DA MINHA DB
- CREATE PROCEDURE WZ_DISCONNECT_MEMB
- @memb___id varchar(10)
- AS
- Begin
- set nocount on
- Declare @find_id varchar(10)
- Declare @ConnectStat tinyint
- Set @ConnectStat = 0 -- Á¢¼Ó »óÅ °ª 1 = Á¢¼Ó, 0 = Á¢¼ÓX
- Set @find_id = 'NOT'
- select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
- where I.memb___id = @memb___id
- if( @find_id <> 'NOT' ) -- Á¢¼Ó Á¾·á 󸮴 Á¢¼Ó 󸮸¦ ÇßÀ»¶§¸¸ À¯È¿ÇÏ°Ô ÇÑ´Ù
- begin
- update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate()
- where memb___id = @memb___id
- end
- end
- GO
- SET QUOTED_IDENTIFIER OFF
- GO
- SET ANSI_NULLS ON
- GO
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- WZ_CONNECT_MEMB: Original da minha DB
- CREATE PROCEDURE WZ_CONNECT_MEMB
- @memb___id varchar(10),
- @ServerName varchar(20),
- @IP varchar(15)
- AS
- Begin
- set nocount on
- Declare @find_id varchar(10)
- Declare @ConnectStat tinyint
- Set @find_id = 'NOT'
- Set @ConnectStat = 1 -- Á¢¼Ó »óÅ °ª 1 = Á¢¼Ó, 0 = Á¢¼ÓX
- select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
- where I.memb___id = @memb___id
- if( @find_id = 'NOT' )
- begin
- insert into MEMB_STAT (memb___id,ConnectStat,ServerName,IP,ConnectTM)
- values(@memb___id, @ConnectStat, @ServerName, @IP, getdate())
- end
- else
- update MEMB_STAT set ConnectStat = @ConnectStat,
- ServerName = @ServerName,IP = @IP,
- ConnectTM = getdate()
- where memb___id = @memb___id
- end
- GO
- SET QUOTED_IDENTIFIER OFF
- GO
- SET ANSI_NULLS ON
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement