CREATE PROCEDURE [prefix_createattachment]
@uid int,
@tid int,
@pid int,
@postdatetime datetime,
@readperm int,
@filename nchar(200),
@description nchar(200),
@filetype nchar(100),
@filesize int,
@attachment nchar(200),
@downloads int,
@extname nvarchar(50),
@attachprice int,
@width int,
@height int,
@isimage tinyint
AS
DECLARE @aid int
INSERT INTO [prefix_attachments]([uid],[tid], [pid], [postdatetime], [readperm], [filename], [description], [filetype], [filesize], [attachment], [downloads],[attachprice],[width],[height],[isimage]) VALUES(@uid, @tid, @pid, @postdatetime, @readperm, @filename, @description, @filetype, @filesize, @attachment, @downloads, @attachprice,@width,@height,@isimage)
SELECT SCOPE_IDENTITY() AS 'aid'
set @aid=(SELECT SCOPE_IDENTITY() AS 'aid')
UPDATE [prefix_posts1] SET [attachment]=1 WHERE [pid]=@pid
INSERT INTO [prefix_myattachments]([aid],[uid],[attachment],[description],[postdatetime],[downloads],[filename],[pid],[tid],[extname]) VALUES(@aid,@uid,@attachment,@description,@postdatetime,@downloads,@filename,@pid,@tid,@extname)
GO
SCOPE_IDENTITY
最新推荐文章于 2019-09-02 16:56:09 发布