[请教]取消同步复制后,对数据库的清扫问题

fan1223 2005-08-31 04:40:44
数据库设定了同步后,对同步的每个表,都会增加一些编号列,取消后,好像没有自动清除,怎么去掉这些列?
...全文
165 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
fan1223 2005-09-13
  • 打赏
  • 举报
回复
up
fan1223 2005-09-06
  • 打赏
  • 举报
回复
怎么没人帮忙啊?是不是问题难了点?
fan1223 2005-09-01
  • 打赏
  • 举报
回复
不是吧,我看到的是msrepl_tran_version和rowguid,类型是uniqueidentifier,not null的字断
还是newid()函数产生的值,但是服务器取消复制后,这个函数就没有用了,插入新记录的时候就会出错
fan1223 2005-09-01
  • 打赏
  • 举报
回复
不对,字段名是msrepl_tran_version和rowguid,类型是uniqueidentifier
我已尝试通过delete from syscolumns 或alter table drop colmun说不能删除..
zengzhengliang 2005-09-01
  • 打赏
  • 举报
回复
我记得同步字段是 timestamp ,如果不是,将下面处理代码中的 timestamp 换成相应类型
lovcal 2005-09-01
  • 打赏
  • 举报
回复
对呀,有些时候删除发布之后就是残留一些信息
不知道重起数据库会不会得到解决
一前我也遇到过这种情况,好像重起就可以了

关注+学习……
zjcxc 2005-08-31
  • 打赏
  • 举报
回复
使用前先备份.
zjcxc 2005-08-31
  • 打赏
  • 举报
回复
我记得同步字段是 timestamp ,如果不是,将下面处理代码中的 timestamp 换成相应类型

--删除表中的所有 timestamp 字段的代码

declare tb cursor local for
select s='alter table ['+a.name+'] drop column ['+b.name+']'
from sysobjects a
join syscolumns b on a.id=b.id
join systypes c on b.xtype=c.xusertype
where c.name='timestamp'

declare @s varchar(8000)
open tb
fetch next from tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch next from tb into @s
end
close tb
deallocate tb




22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧