Problem with tbh stored procedures! Help
Some of the features that are used in development of the database are SQL 2005 version... My hosting company version is 2000.
Anyway, Row_Number function that is used in development is not supported on the 2000 version.
Affected procedres that i cannot execute and create are:
tbh_Articles_GetArticles
tbh_Articles_GetComments
tbh_Articles_GetCommentsByArticles
tbh_Articles_GetPublishedArticles
tbh_Articles_GetArticlesByCategory
tbh_Articles_GetPublishedArticlesByCategory
Here what the querry file looks like:
/****** Object: StoredProcedure [dbo].[tbh_Articles_GetArticles] Script Date: 07/30/2007 15:56:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[tbh_Articles_GetArticles]
(
@PageIndex int,
@PageSize int
)
AS
SET NOCOUNT ON
SELECT * FROM
(
SELECT tbh_Articles.ArticleID, tbh_Articles.AddedDate, tbh_Articles.AddedBy, tbh_Articles.CategoryID, tbh_Articles.Title, tbh_Articles.Abstract, tbh_Articles.Body,
tbh_Articles.Country, tbh_Articles.State, tbh_Articles.City, tbh_Articles.ReleaseDate, tbh_Articles.ExpireDate, tbh_Articles.Approved,
tbh_Articles.Listed, tbh_Articles.CommentsEnabled, tbh_Articles.OnlyForMembers, tbh_Articles.ViewCount, tbh_Articles.Votes, tbh_Articles.TotalRating,
tbh_Categories.Title AS CategoryTitle,
ROW_NUMBER() OVER (ORDER BY ReleaseDate DESC) AS RowNum
FROM tbh_Articles INNER JOIN
tbh_Categories ON tbh_Articles.CategoryID = tbh_Categories.CategoryID
) Articles
--WHERE Articles.RowNum BETWEEN (@PageIndex*@PageSize+1) AND ((@PageIndex+1)*@PageSize)
ORDER BY ReleaseDate DESC
GO
__________________________________________
So Help me please how to revrite Row_Number function to be compatable with sql 2000
Thank you in advance
|