Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, pls i have a web app using sql server db and running on a parellel plesk host.
The stored procedure does not run fine.
USE [CashX]
GO

/****** Object:  StoredProcedure [dbo].[BonusSystem]******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[BonusSystem]
@Username varchar(20), @Amount money, @Msg varchar(MAX)
AS
IF @Username = 'AllFxMembers'
BEGIN
UPDATE tblAccounts SET Total += @Amount
UPDATE tblUsers SET PrivateMsg=@Msg
END
ELSE
BEGIN
UPDATE tblAccounts SET Total += @Amount WHERE Username=@Username
UPDATE tblUsers SET PrivateMsg=@Msg WHERE Username=@Username
END

GO


It works fine only for the second update command. my database name online is 00fxfundsi_ while am using CashX locally as my database name. Pls what could be the cause of this problem?
HELP ME PLEASE
Posted
Updated 18-Dec-13 7:42am
v2
Comments
Corporal Agarn 18-Dec-13 14:22pm    
What is it doing that is not working?
Maciej Los 18-Dec-13 15:50pm    
Please, improve question and add code behind.
Jashobanta 18-Dec-13 16:25pm    
What is the error you are getting?
BK 4 code 19-Dec-13 6:58am    
What is data type of Total column in tblAccounts?
[no name] 19-Dec-13 7:28am    
Hi Guys,i works fine locally, i just checked the database online and every thing is working fine, its just a datareader error am still trying to fight... Thanks.

1 solution

It was just a datareader error that reads a NULL field which led to terminating my entire sub, thanks for your time
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900