I
Iwan Petrow
Hi,
I have a store procedure like this:
CREATE PROCEDURE AAA
@p1 int
@p2 datetime
@id int OUTPUT
AS
SET @id=(SELECT id FROM table1
WHERE p1=@p1 AND p2=@p2)
But p1, p2, @p1 and @p2 could be NULL and this is a problem because
it can happen something like this: p1=NULL (I use DbNull.Value to set
null parameters).
What could I do to deal with this problem? How to change the store
procedure? Or may be any ideas about c# code?
Thanks.
I have a store procedure like this:
CREATE PROCEDURE AAA
@p1 int
@p2 datetime
@id int OUTPUT
AS
SET @id=(SELECT id FROM table1
WHERE p1=@p1 AND p2=@p2)
But p1, p2, @p1 and @p2 could be NULL and this is a problem because
it can happen something like this: p1=NULL (I use DbNull.Value to set
null parameters).
What could I do to deal with this problem? How to change the store
procedure? Or may be any ideas about c# code?
Thanks.