files_postattachment_get.prc

来自「community server 源码」· PRC 代码 · 共 44 行

PRC
44
字号
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

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







create procedure [dbo].files_PostAttachment_Get
(
	@PostID int,
	@UserID int=0,
	@LogDownload bit=0
)
AS

if @LogDownload = 1
begin
	INSERT files_Downloads (UserID, PostID, DownloadDate) VALUES (@UserID, @PostID, getdate())
end

SELECT
	*
FROM
	cs_PostAttachments
WHERE
	PostID = @PostID


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

grant execute on [dbo].[files_PostAttachment_Get] to public
go

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?