I have a stored procedure, uspUser_GetUserDetails, with several parameters. It gets called something like this:
uspUser_GetUserDetails 'LastName','FirstName', 'UserId', 'dtDate', 'DistrictId'
How do I run the stored procedure if the dtDate parameter is null. I tried
uspUser_GetUserDetails 'LastName','FirstName','UserId','','DistrictId'
but it doesn't do anything. Will something like this work?
uspUser_GetUserDetails 'LastName','FirstName','UserId',null,'DistrictId'
This takes forever to execute the query without returning any result. Note that the question is not about how to create a SP with a nullable parameter. My SP works fine from C#, it shows sqlvalue {null} in the parameters. I just want to test it quickly from SQL server management studio and know how to pass null parameter to it in this situation.