首页 新闻 会员 周边 捐助

sql存储过程错误

0
[待解决问题]

ALTER PROCEDURE [dbo].[InsertCTopices]
@newid NVARCHAR(100) output,
@Title NVARCHAR(1000),
@Contents varchar(max),
@AuthorUserId bigint,
@AuthorUserName NVARCHAR(1000),
@PageViews int,
@InsertTime NVARCHAR(1000),
@PostUserId bigint,
@PostUserName NVARCHAR(1000),
@PostTime NVARCHAR(1000),
@State NVARCHAR(1000),
@CommunityId bigint,
@CTopicesTypeId NVARCHAR(1000)
AS
SET NOCOUNT ON;
BEGIN
DECLARE @sqlstr NVARCHAR(MAX)
SET @sqlstr = 'INSERT INTO [CTopices] (Title,Contents,AuthorUserId,AuthorUserName,PageViews,InsertTime,PostUserId,PostUserName,PostTime,[State],CommunityId,CTopicesTypeId) VALUES ( '''+@Title+''','''+@Contents+''','+ CONVERT(nvarchar,@AuthorUserId,1000)+','''+@AuthorUserName+''','+CONVERT(nvarchar,@PageViews,1000)+','''+@InsertTime+''','+CONVERT(nvarchar,@PostUserId,1000)+','''+@PostUserName+''','''+@PostTime+''','''+@State+''','+CONVERT(nvarchar,@CommunityId,1000)+','''+@CTopicesTypeId+''');';
SET @sqlstr = @sqlstr + 'SELECT @newid = SCOPE_IDENTITY();';
END

rains的主页 rains | 小虾三级 | 园豆:860
提问于:2012-10-15 10:51
< >
分享
所有回答(2)
0

具体是什么错误啊?

chenping2008 | 园豆:9836 (大侠五级) | 2012-10-15 11:04
0

EXEC(@sqlstr)

哇~怪兽 | 园豆:622 (小虾三级) | 2012-10-15 13:23
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册