------下面更新线路,先将线路表导入临时表tempd
go
select * from touristline
go
insert into tempd([name],content) select touristlinename,touristlinesynopsis from touristline
go
select * from tempd
go----下面更新版块号,用户号
update tempd set fid='5'
update tempd set poster='用户名'
update tempd set posterid='用户ID'
update tempd set tid=[id]+已经有的帖子最大编号
update tempd set pid=[id]+已经有的帖子最大编号
go----下面为更新dnt_topics
insert into dnt_topics(tid,fid,title,poster,posterid) select tid,fid,[name],poster,posterid from tempd
go----下面为更新dnt_posts1
insert into dnt_posts1(pid,fid,tid,title,message,poster,posterid) select [pid],fid,tid,[name],content,poster,posterid from tempd
go----下面为更新dnt_topics表的lastpostid字段
update dnt_topics set lastpostid=tid+lastpostid与pid的差值 where lastpostid=0