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)
Loading

Vithal WadjeRank #19 · 47.2K reputationPosted Dec 23, 2012, 6:20 PM EST
Pradip PandeyRank #452 · 5.6K reputationPosted Dec 23, 2012, 7:25 PM EST
if @Cust_newName is not null
and
if @Cust_Addrs is not null
Hope it will help.
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Dec 24, 2012, 8:40 PM EST
If you are getting an error, send me the error we may help you out.
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Dec 24, 2012, 11:20 PM EST
When you say @something <> null, this one is not a proper validation for null check.
you have to say @something is not null, then do something..
Always in SQL, write "Is null" instead of "= null"
and "is not null" instead of "<>null"
Otherwise you wont get your desired output