Hi guys,
I'm new at SQL Server and was wondering if you can help me with this one.
I have a simple SP that have one param.
What I would like it do to is that when I'm not sending any value to this param, the SP will return all rows. The ones that are null and the one that are not. Is this possible?
This is my SP
CREATE PROCEDURE usp_Get_All_Patent_Actions_Report
@file_no nvarchar(100) = NULL
AS
SELECT
[File].file_no, [File].Note
FROM
[File]
WHERE ([File].main_type = 1) AND
[File].file_no=@file_no
I'm new at SQL Server and was wondering if you can help me with this one.
I have a simple SP that have one param.
What I would like it do to is that when I'm not sending any value to this param, the SP will return all rows. The ones that are null and the one that are not. Is this possible?
This is my SP
CREATE PROCEDURE usp_Get_All_Patent_Actions_Report
@file_no nvarchar(100) = NULL
AS
SELECT
[File].file_no, [File].Note
FROM
[File]
WHERE ([File].main_type = 1) AND
[File].file_no=@file_no