troubleshooting Question

How to check inside stored procedure if parameter is empty?

Avatar of immtrac
immtrac asked on
Microsoft SQL Server 2005
3 Comments1 Solution3696 ViewsLast Modified:
I have 2 text boxes on Web page. One the first time page load there are values in it.

on save I am updating my DB using stored procedure.

The way user can remove the record from DB is just making both text boxes blank. i.e. just remove values from text boxes. And in stored procedure I will check if both parameters  are empty just delete the record. If there are something in parameters update record.

How do I check if stored procedure parameters are empty?
 I tried

if @abc = ' '
if len(@abc=0)

but not of these are workig

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros