ahmed fahd

ahmed fahd

  • NA
  • 58
  • 46.2k

what is wrong in this procedure

Dec 23 2012 9:34 AM
i test my code in vb.net it's ok has no mistakes
so the probelm is here also this query was working with the code but i don't know what happend :(
some one can tell me my

create PROCEDURE Customes_Tables_Update
(@Cust_newName nvarchar(50),@Cust_Name nvarchar(50),@Cust_Addrs nvarchar(50),@Brch_ID int,@cust_id int)

AS

if @Brch_ID <> 0
    UPDATE       Customes_Tables
    SET               Brch_ID = @Brch_ID
    WHERE        (Cust_Name = @Cust_Name or cust_id=@cust_id)
    
    if @Cust_newName <> null
    UPDATE       Customes_Tables
    SET               Cust_Name=@Cust_newName
    WHERE        (Cust_Name = @Cust_Name or cust_id=@cust_id)

   
   
   
    if @Cust_Addrs <> null
    UPDATE       Customes_Tables
    SET         Cust_Addrs = @Cust_Addrs
    WHERE        (Cust_Name = @Cust_Name or cust_id=@cust_id)

Answers (4)