Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
T-SQL to drop ROWGUID designation
Message
From
14/01/2010 15:23:06
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01444011
Message ID:
01444040
Views:
163
>>>AFAIK RowGuid sets the default value for the field to be NewID()
>>
>>My problem here is not the default value. I have a pk that is a UID. The ROWGUID property of the key is set to YES. I can change it manually to NO but I want to do it in TSQL.
>>
>>I have found that if I drop the PK entirely so that neither the key or the index or the column flag are showing anymore I still cannot create a new PK on that column with SMO as it still sees it as a rowguid.
>>
>>I thought blowing away the key would do it, since that was where the rowguid property was found, but it seems there is something else going on. I looked for a table property to reset but saw nothing there either.
>
>Would you please post a script for the table? I asked my friends to help with this question.

Thanks but I realized I was forgetting the obvious (ie. BOL alter table docs )'

ALTER tablename ALTER column DROP ROWGUIDCOL

When I get all done with this I'll post some scripts others may find useful. i have a lot of VFP databases that use GUID keys and in moving them to .NET apps I'm going to be going with identity ints.


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform