SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Update and Case problem ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

oguzkaygun
Yak Posting Veteran

53 Posts

Posted - 04/15/2012 :  06:31:57  Show Profile  Reply with Quote
Hello
Below query give me error. What can be problem ?
@_borc is 100 and @x_id is 6
UPDATE x_carikarti
SET x_bakiye = CASE WHEN x_borcalacak = 'B' THEN x_bakiye - @x_borc WHEN x_borcalacak = 'A' THEN x_bakiye + @x_borc END
WHERE (x_id = @x_id)

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 04/15/2012 :  08:33:29  Show Profile  Reply with Quote
The error message would indicate what the problem is. The syntax looks fine. If you post the error message people on this forum would be able to offer more concrete advice.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 04/15/2012 :  15:09:46  Show Profile  Reply with Quote
my guess is data type of x_bakiye is incompatible with datatype of variable @x_borc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

financing
Starting Member

India
1 Posts

Posted - 04/16/2012 :  04:44:17  Show Profile  Reply with Quote
The syntax looks fine. If you post the error message people on this forum would be able to offer more concrete advice.

unspammed
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000