SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

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

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

CREATE PROC [dbo].cs_Feed_GetUsers
	@SettingsID INT
AS


	SELECT U.*
	FROM  cs_vw_Users_FullUser U
	WHERE U.SettingsID = @SettingsID 
		and U.cs_UserID in (select distinct UserID from cs_Folder where SettingsID = @SettingsID)
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

GRANT  EXECUTE  ON [dbo].[cs_Feed_GetUsers]  TO [public]
GO

