现在的位置: 首页 > 综合 > 正文

rowguid列删除

2013年09月15日 ⁄ 综合 ⁄ 共 2696字 ⁄ 字号 评论关闭


<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:1;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:"/@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:宋体;
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;
mso-font-kerning:1.0pt;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->

 复制失败或删除复制时,可能会造成一些遗留问题,这个是经常见到的,而且这样的情况还经常发生,复制的使用过程中还是存在诸多问题的,朋友们可以一起说出来,改天找个微软的工程师问问如何解决,反正现在我有很多的问题不能解决,可能大家的复制应用还是比较少,真正使用起来还是有些疑惑的。

 

drop
rowguid indexes

select
'drop index '
+
sysobjects.
name +
'.'
+
sysindexes.
name from

sysindexes

inner
join
sysobjects

on
sysindexes.
id =
sysobjects.
id

where
objectproperty
(
object_id
(
sysobjects.
name),
'IsMSShipped'
)
=
0

and
sysindexes.
indid >
0 and
sysindexes.
indid <
255 and
(
sysindexes.
status &

64)=
0

and
index_col
(
sysobjects.
name,
sysindexes.
indid,
1)
=
'rowguid'

order
by
sysindexes.
indid

 

–remove rowguid default
constraints

select
'alter table '
+
b.
name +
' drop constraint '
+
a.
name from

sysobjects a

inner
join
syscolumns on
syscolumns.
id =
a.
parent_obj

inner
join
sysobjects b on
syscolumns.
id =
b.
id

where
syscolumns.
name =
'rowguid'

and
objectproperty
(
object_id
(
b.
name),
'IsMSShipped'
)
=
0

and
a.
xtype =
'D'

 

–remove rowguid columns

select
'alter table '
+
sysobjects.
name +
' drop column rowguid '
from

syscolumns

inner
join
sysobjects on
syscolumns.
id =
sysobjects.
id

where
syscolumns.
name =
'rowguid'

and
objectproperty
(
object_id
(
sysobjects.
name),
'IsMSShipped'
)
=
0

 

抱歉!评论已关闭.