,又学了点关于存储过程的知识
数据的类型和长度要和当初建表时定义的类型长度一致。
CREATE PROCEDURE HVC_ChatRoom_UpdateTopic
(
@topic_id int,
@title nvarchar(255),
@summary nvarchar(2000),
@time datetime,
@guests nvarchar(255),
@imgurl nvarchar(255)
)
AS
UPDATE HVC_ChatRoom_TopicsList
SET
inTitle = @title,
inSummary = @summary,
inGuests = @guests,
inTime = @time,
inImgUrl = @imgurl
WHERE TopicId = @topic_id
GO
update数据时一定要把数据item的类型和长度写清楚,要是不写长度,系统会默认只取第一个字符。(
@topic_id int,
@title nvarchar(255),
@summary nvarchar(2000),
@time datetime,
@guests nvarchar(255),
@imgurl nvarchar(255)
)
AS
UPDATE HVC_ChatRoom_TopicsList
SET
inTitle = @title,
inSummary = @summary,
inGuests = @guests,
inTime = @time,
inImgUrl = @imgurl
WHERE TopicId = @topic_id
GO
数据的类型和长度要和当初建表时定义的类型长度一致。