Stored Procedure Icon dbo.forums_GetPrevPostID

Stored Procedure Properties

Name Value
Owner dbo
Created 2004-05-31
Startup False
Encrypted False

Creation Options

Name Value
QUOTED_IDENTIFIER OFF
ANSI_NULLS OFF

Parameters

Name DataType Length Type
@ThreadID int 4 INPUT
@SortOrder int 4 INPUT
@ForumID int 4 INPUT
@PrevPostID int 4 OUTPUT

Total: 4 parameter(s)

SQL

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO




create procedure forums_GetPrevPostID
(
	@ThreadID int,
	@SortOrder int,
	@ForumID int,
	@PrevPostID int OUTPUT
)
 AS
SELECT TOP 1 @PrevPostID = PostID
FROM Posts (nolock)
WHERE ThreadID = @ThreadID AND ForumID = @ForumID AND SortOrder = @SortOrder-1 AND Approved = 1
IF @@ROWCOUNT < 1
	SELECT @PrevPostID = 0















GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


					

Generated on 26/08/2004 15:05:29 by DataAide.