22,210
社区成员
发帖
与我相关
我的任务
分享
ALTER PROCEDURE UP_Questions_ADD
@itemid int ,
@itemValue varchar(1000)
AS
INSERT INTO Questions(
[author],[Q_Note],[Q_Content],[ImageName],[HiteCounter],[AnsCounter],[ReleaseTime],[ReferTime],[BigClass_ID],[SmallClass_ID],[kind],[solved]
) select top 20 'waitingline' as author,title,content,
photourl,
'0' as HiteCounter,
'0' as AnsCounter,
getdate() as ReleaseTime,
getdate() as ReferTime,
(select bigclassid from zl_collitem where zl_collitem.[id]=zl_collection.itemid) as BigClass_ID,
(select smallclassid from zl_collitem where zl_collitem.[id]=zl_collection.itemid) as smallclass_ID,
'1' as kind,
'0' as solved from zl_collection
where itemid=@itemid and charindex(','+[id]+',',','+@itemValue+',') > 0
delete from zl_collection where itemid=@itemid and charindex(','+[id]+',',','+@itemValue+',') > 0
ALTER PROCEDURE UP_Questions_ADD
@itemid int ,
@itemValue varchar(1000)
AS
INSERT INTO Questions(
[author],[Q_Note],[Q_Content],[ImageName],[HiteCounter],[AnsCounter],[ReleaseTime],[ReferTime],[BigClass_ID],[SmallClass_ID],[kind],[solved]
) select top 20 'waitingline' as author,title,content,
photourl,
'0' as HiteCounter,
'0' as AnsCounter,
getdate() as ReleaseTime,
getdate() as ReferTime,
(select bigclassid from zl_collitem where zl_collitem.[id]=zl_collection.itemid) as BigClass_ID,
(select smallclassid from zl_collitem where zl_collitem.[id]=zl_collection.itemid) as smallclass_ID,
'1' as kind,
'0' as solved from zl_collection
where itemid=@itemid and
--[id] in (@itemValue) 改为
charindex(','+ltrim(id)+',',','+@itemValue+',') >0
delete from zl_collection where itemid=@itemid and
--[id] in (@itemValue)改为
charindex(','+ltrim(id)+',',','+@itemValue+',')>0