hi
below is SP:
USE [Digimaster]
GO
/****** Object: StoredProcedure [dbo].[GetCustomersPageWiseFilm] Script Date: 02/08/2017 18:37:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[GetCustomersPageWiseFilm]
@PageIndex INT = 1
,@PageSize INT = 5
,@RecordCount INT OUTPUT
,@Genre nvarchar(100)
AS
BEGIN
SET NOCOUNT ON;
SELECT ROW_NUMBER() OVER
(
ORDER BY [Date] desc
)AS RowNumber
,[ID]
,ImageCover
,ImageDetail
,[Date]
,[ImageName]
,[Code]
INTO #Results
FROM [SerialFilm]
where ((Oskar=@Genre)or(Animation=NULL)or (@Genre=N'همه')) and(Daste=N'فیلم' AND Animation<>N'انیمیشن')
SELECT @RecordCount = COUNT(*)
FROM #Results
SELECT * FROM #Results
WHERE RowNumber BETWEEN(@PageIndex -1) * @PageSize + 1 AND(((@PageIndex -1) * @PageSize + 1) + @PageSize) - 1
DROP TABLE #Results
END
this SP will shows data from serialfilm table where
((Oskar=@Genre)or(Animation=NULL)or (@Genre=N'همه')) and(Daste=N'فیلم' AND Animation<>N'انیمیشن')
as you see I define it will show data where
(Oskar=@Genre)or(Animation=NULL)
but here if Animation Column=NULL it doesn't show that row's data it just shows data that in Animation column's wasn't any thing even NULL...
Best Regards
Neda