Junior Spellweaver
- Joined
- Feb 12, 2012
- Messages
- 102
- Reaction score
- 6
Im trying to run this query
But im getting this error:
Im using SQL2008 R2 and TT Files and DB's. Please help.
Code:
CREATE PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
[USER=1333365783]mem[/USER]b___id varchar(10)
AS
Begin
set nocount on
Declare [USER=1333416677]Find[/USER]_id varchar(10)
Declare [USER=1333459481]Connects[/USER]tat tinyint
declare [USER=27501]OnLine[/USER]Hours real
declare [USER=1333377105]Credits[/USER] int
Set [USER=1333459481]Connects[/USER]tat = 0
Set [USER=1333416677]Find[/USER]_id = 'NOT'
select [USER=1333416677]Find[/USER]_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( [USER=1333416677]Find[/USER]_id <> 'NOT' )
begin
SELECT [USER=1333377105]Credits[/USER]= credits FROM MEMB_INFO where memb___id = 'account'
update MEMB_STAT set ConnectStat = [USER=1333459481]Connects[/USER]tat, DisConnectTM = getdate(), OnlineHours = [USER=1333377105]Credits[/USER]/10+(DATEDIFF(hh,ConnectTM,getdate()))
where memb___id = 'account'
SELECT [USER=27501]OnLine[/USER]Hours =OnlineHours FROM MEMB_STAT WHERE memb___id = 'account'
UPDATE [dbo].[MEMB_INFO]
SET credits= [USER=27501]OnLine[/USER]Hours * 10)
WHERE memb___id = 'account'
end
end
GO
But im getting this error:
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'.
Im using SQL2008 R2 and TT Files and DB's. Please help.