Include a ‘GetJustStage’ stored procedure to get only stage data and not get its related data
This commit is contained in:
parent
86bdecd367
commit
9671a394be
@ -10363,3 +10363,36 @@ GO
|
|||||||
IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_StepChildItems Succeeded'
|
IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_StepChildItems Succeeded'
|
||||||
ELSE PRINT 'TableFunction Creation: vefn_StepChildItems Error on Creation'
|
ELSE PRINT 'TableFunction Creation: vefn_StepChildItems Error on Creation'
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getJustStage]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
|
DROP PROCEDURE [getJustStage];
|
||||||
|
GO
|
||||||
|
/****** Object: StoredProcedure [dbo].[getJustStage] ******/
|
||||||
|
/*****************************************************************************
|
||||||
|
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
|
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||||
|
*****************************************************************************/
|
||||||
|
Create PROCEDURE [dbo].[getJustStage]
|
||||||
|
(
|
||||||
|
@StageID int
|
||||||
|
)
|
||||||
|
WITH EXECUTE AS OWNER
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
[StageID],
|
||||||
|
[Name],
|
||||||
|
[Description],
|
||||||
|
[IsApproved],
|
||||||
|
[DTS],
|
||||||
|
[UserID],
|
||||||
|
[LastChanged],
|
||||||
|
(SELECT COUNT(*) FROM [Checks] WHERE [Checks].[StageID]=[Stages].[StageID]) [CheckCount],
|
||||||
|
(SELECT COUNT(*) FROM [Versions] WHERE [Versions].[StageID]=[Stages].[StageID]) [VersionCount]
|
||||||
|
FROM [Stages]
|
||||||
|
WHERE [StageID]=@StageID
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
-- Display the status of Proc creation
|
||||||
|
IF (@@Error = 0) PRINT 'Procedure Creation: getJustStage Succeeded'
|
||||||
|
ELSE PRINT 'Procedure Creation: getJustStage Error on Creation'
|
||||||
|
GO
|
Loading…
x
Reference in New Issue
Block a user