
/****** Object:  StoredProcedure [getSessions] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getSessions]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
    DROP PROCEDURE [getSessions];
GO
	
CREATE PROCEDURE [dbo].[getSessions]

WITH EXECUTE AS OWNER
AS
	SELECT
		[SessionID],
		[UserID],
		[DTSDtart],
		[DTSEnd],
		[DTSActivity],
		[LastChanged],
		[MachineName],
		[ProcessID]
	FROM [Sessions]
	RETURN
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: getSessions Succeeded'
ELSE PRINT 'Procedure Creation: getSessions Error on Creation'
GO
