开发者

How to remove ROWGUID designation on a PK column/key

I am attempting to strip a datab开发者_Python百科ase of its current UID pks (while retaining the column) as part of a conversion process which will use all int keys.

SSMS 2008 (SQL Express 2008) - Database originally created in SQL 2000.

SQL 2008 full also installed if it helps.

A number of the tables have a UID pk which is ROWGUID=yes

It seems the ROWGUID designation is only found in the KEY properties. I can turn it off there but I'd like to do it as part of a script. If I do a SCRIPT TO on the key or the index I don't see anything indicating the column is a rowguid.

SMO still sees the column as a rowguid after the PK is dropped and the key and index no longer shows in SSMS.

I am a TSQL idiot, so feel free to speak slowly and use small words ;-)

Guidance appreciated. TIA


Did you try:

ALTER TABLE dbo.<table>
  ALTER COLUMN <column>
  DROP ROWGUIDCOL;

If you're going to become proficient with altering tables via script (which is a great idea, since it is source controllable, much more repeatable and far less error-prone than using the UI), I'd bookmark the ALTER TABLE topic in Books Online.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜