SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[cs_Roller_GetFeeds]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[cs_Roller_GetFeeds]
GO

CREATE PROC [dbo].cs_Roller_GetFeeds
	@UserId INT
AS


SELECT 	f.FeedId,
	f.Title,
	f.Url,
	f.Link
FROM 	cs_Feed f,
	cs_FolderFeed ff
WHERE f.FeedId = ff.FeedId
  AND ff.UserId = @UserId
ORDER BY Title


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

GRANT EXECUTE ON [dbo].cs_Roller_GetFeeds  TO PUBLIC
GO
