SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[P_GetRead]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[P_GetRead]

(

@startIndex int, @endIndex int ,@SqlQuery varchar(4000)

)

AS

begin

SET @SqlQuery=@SqlQuery+'' and Row BETWEEN ''+cast(@startIndex as varchar) +'' and ''+cast(@endIndex as varchar)

EXecute(@SqlQuery)

end

' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[P_GetCount]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[P_GetCount]

(

@SqlQuery varchar(4000)

)

AS

EXecute(@SqlQuery)

RETURN

' 
END
