SqlServer2000在设置发布以后,如果删除在表里自动添加的RowGuid

zhouzhongteng 2009-07-31 01:05:28
SqlServer2000,将数据库发布,取消发布以后发现每个表都添加了RowGuid和一些系统表。请问如何删除RowGuid和这些系统表。
...全文
283 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
soft_wsx 2009-08-01
  • 打赏
  • 举报
回复
关注
xiequan2 2009-08-01
  • 打赏
  • 举报
回复
提供3种方法
1:使用存储过程sp_removedbreplication 从数据库中删除所有复制对象。此存储过程在发布服务器上对发布数据库执行,或者在订阅服务器上对订阅数据库执行。在发布服务器上对发布数据库执行时,将尝试删除与分发服务器和订阅服务器上已发布的数据库相关的对象。
exec sp_removedbreplication '订阅名 '
2:工具-复制--禁用
3:备份你的订阅数据库,再还原覆盖你原来的数据库.
feixianxxx 2009-08-01
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 sdhdy 的回复:]
引用 4 楼 feixianxxx 的回复:
SQL code--删除系统表DECLARE c2cursorforselect'drop table ['+name+'];'from sysobjectswhere xtype='s'open c2declare@c2varchar(8000)fetchnextfrom c2into@c2while(@@fetch_status=0)beginexec(@c2)fetchnextfrom c2¡­

你这么做,会把所有的系统表都删除的,后果是灾难性的。
[/Quote]
所有的?
MASTER 的也删么额?不能限定数据库么》
zhouzhongteng 2009-07-31
  • 打赏
  • 举报
回复
有没有发布的回滚,那样删肯定是不行的。
ai_li7758521 2009-07-31
  • 打赏
  • 举报
回复
alter table TB drop column RowGuid
sdhdy 2009-07-31
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 feixianxxx 的回复:]
SQL code--删除系统表DECLARE c2cursorforselect'drop table ['+name+'];'from sysobjectswhere xtype='s'open c2declare@c2varchar(8000)fetchnextfrom c2into@c2while(@@fetch_status=0)beginexec(@c2)fetchnextfrom c2¡­
[/Quote]
你这么做,会把所有的系统表都删除的,后果是灾难性的。
feixianxxx 2009-07-31
  • 打赏
  • 举报
回复
--删除系统表
DECLARE c2 cursor for
select 'drop table ['+name +']; '
from sysobjects
where xtype = 's'
open c2
declare @c2 varchar(8000)
fetch next from c2 into @c2
while(@@fetch_status=0)
begin
exec(@c2)
fetch next from c2 into @c2
end
close c2
deallocate c2
--小F-- 2009-07-31
  • 打赏
  • 举报
回复
如果是单纯的删除 就看1楼的
--小F-- 2009-07-31
  • 打赏
  • 举报
回复
??不是很明白
sdhdy 2009-07-31
  • 打赏
  • 举报
回复

--关键问题是以后你不发布了?
--如果要删除字段,就用。
alter table tablename drop column columnname
--如果要删除表,就用。
drop table tablaname

22,210

社区成员

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

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