📄 cs_postattachment_update.prc
字号:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[cs_PostAttachment_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[cs_PostAttachment_Update]
GO
create procedure [dbo].cs_PostAttachment_Update
(
@PostID int,
@UserID int,
@SectionID int,
@Filename nvarchar(1024),
@FriendlyFileName nvarchar(256) = null,
@Content image = null,
@ContentType nvarchar(50),
@ContentSize int,
@IsRemote int,
@SettingsID int,
@MetaDataOnly bit,
@Height int = 0,
@Width int = 0
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
BEGIN
IF EXISTS (SELECT PostID FROM cs_PostAttachments WHERE PostID = @PostID and SettingsID = @SettingsID )
begin
UPDATE cs_PostAttachments SET
[FileName] = @Filename,
[FriendlyFileName] = @FriendlyFileName,
ContentSize = @ContentSize,
IsRemote = @IsRemote,
[Height] = @Height,
[Width] = @Width
WHERE
PostID = @PostID and
SettingsID = @SettingsID
if(@MetaDataOnly = 0)
Begin
UPDATE cs_PostAttachments SET
Content = @Content
WHERE
PostID = @PostID and
SettingsID = @SettingsID
End
end
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
grant execute on dbo.[cs_PostAttachment_Update] to public
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -