KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When searching for a list of products, the @SearchType parameter is optional. If @SearchType is empty or NULL then it should return all products and not use the WHERE clause. Otherwise, if it passed Equipment it would then use that instead. ALTER PROCEDURE [dbo].[psProducts] (@SearchType varchar(50)) AS BEGIN SET NOCOUNT ON; SELECT P.[ProductId], P.[ProductName], P.[ProductPrice], P.[Type] FROM [Product] P -- if @Searchtype is not null then use the where clause WHERE p.[Type] = @SearchType END
Tags (comma-separated)
Save Edits
Cancel