Stored Procedure expects parameter ??? which was not supplied

I have a VB.Net windows app that call a SP. The message I'm getting (which is the title of this thread) I know that this error is misleading because the parameter does exist in every location that it is supposed to be in. My thought though is that the value I'm passing from the field in question contains NULL...could that be the cause of this error?
Who is Participating?
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:

@variable                          INT = NULL,

specify explicit parameters while calling the sp
Aneesh RetnakaranDatabase AdministratorCommented:
you need to pass all the parameters, even if is null
Alternative option will be to alter the stored procedure to make some of the parameters null (just add   = null  after the input variable ), then you can specify the input parameter and its value when calling the sp thru your application
BlakeMcKennaAuthor Commented:
I was thinking about changing the SP. Is it like this?

@variable                          INT, NULL
BlakeMcKennaAuthor Commented:
That worked great. Wish I would have known about that little trick...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.