[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

update

Posted on 2013-05-30
1
Medium Priority
?
342 Views
Last Modified: 2013-05-30
I am not sure how to write this update statement, depending on @feeoption.

create procedure  Updatefees
@id   int,
@amountpay    int,
@amount_customer  int,
@feeoption   varchar(6)

as

if @feeoption = 'both'
    update mytable  set payaccount = '0', set payclient = '0' where id =@id
if @feeoption = 'client'
    update mytable  set payaccount = @amountpay ', set payclient = '0'  where id =@id
if @feeoption = 'customer'
   update mytable set payaccount = @amountpay ', set payclient = @amount_customer   where id =@id
0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
manbehindthecurtain earned 2000 total points
ID: 39209599
create procedure  Updatefees
@id   int,
@amountpay    int,
@amount_customer  int,
@feeoption   varchar(6)

as

if @feeoption = 'both'
begin
    update mytable  set payaccount = '0',  payclient = '0' where id =@id
    end
if @feeoption = 'client'
begin
    update mytable  set payaccount = @amountpay ,  payclient = '0'  where id =@id
    end
if @feeoption = 'customer'
begin
   update mytable set payaccount = @amountpay ,  payclient = @amount_customer   where id =@id
   end
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question