Im trying to run this query
But im getting this error:Code:CREATE PROCEDURE [dbo].[WZ_DISCONNECT_MEMB] @memb___id varchar(10) AS Begin set nocount on Declare @Find_id varchar(10) Declare @Connectstat tinyint declare @OnLineHours real declare @Credits int Set @Connectstat = 0 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 = 'account' if( @Find_id <> 'NOT' ) begin SELECT @Credits= credits FROM MEMB_INFO where memb___id = 'account' update MEMB_STAT set ConnectStat = @Connectstat, DisConnectTM = getdate(), OnlineHours = @Credits/10+(DATEDIFF(hh,ConnectTM,getdate())) where memb___id = 'account' SELECT @OnLineHours =OnlineHours FROM MEMB_STAT WHERE memb___id = 'account' UPDATE [dbo].[MEMB_INFO] SET credits= @OnLineHours * 10) WHERE memb___id = 'account' end end GO
Im using SQL2008 R2 and TT Files and DB's. Please help.Code:Msg 207, Level 16, State 1, Procedure WZ_DISCONNECT_MEMB, Line 16 Invalid column name 'credits'. Msg 207, Level 16, State 1, Procedure WZ_DISCONNECT_MEMB, Line 22 Invalid column name 'credits'.







