webressurs
asked on
Howto select articles with ParentId = NULL?
I have a stored procedure (see below) that take out all articles based on @ParentId. It works good, but some articles has ParentId = NULL in the database. When @ParentID = Null or nothing, it dont return the articles with parentId = NULL. What is wrong, how can I get the articles with ParentId = NULL?
ALTER PROCEDURE [dbo].[spGetContentsForTre eview]
(
@ParentId int = null
)
AS
SELECT Id, [Name] FROM tblContent WHERE ParentId=@ParentId
ALTER PROCEDURE [dbo].[spGetContentsForTre
(
@ParentId int = null
)
AS
SELECT Id, [Name] FROM tblContent WHERE ParentId=@ParentId
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.