Last active
June 3, 2019 07:03
-
-
Save sculouis/d32fa3d51bd7c19c2c014bfd328396fc to your computer and use it in GitHub Desktop.
Store Procedure傳入的參數若不是全部有傳則Where條件的寫法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER PROCEDURE [ERP].[usp_GetProjectSummaryData] | |
@ProjectCategoryID UniqueIdentifier Null | |
,@ProjectID UniqueIdentifier Null | |
AS | |
BEGIN | |
-- SET NOCOUNT ON added to prevent extra result sets from | |
-- interfering with SELECT statements. | |
SET NOCOUNT ON; | |
Select * | |
From Project P | |
Where ProjectCategoryID = isnull(@ProjectCategoryID,ProjectCategoryID) | |
And ProjectID = isnull(@ProjectID,ProjectID) | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment