Identity columns are also difficult to maintain. Though you can force the
insertion of an identity column in SQL Server (SET IDENTITY_INSERT ON), it's
impossible to update an identity column. Furthermore, there is no command
for dropping an identity and adding it back.

You have to create a new table without the identity, copy the data to that
table, drop all indexes and constraints on the old table, drop the old
table, recreate it without the identity, copy the database back over, and
add all the constraints and such back.

So, technically, it can be done programmatically. However, you usually end
up with hundreds of lines of code for even a simple table structure.

This all becomes an issue when you're moving a configuration or data from
development to staging to production.

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Dave Watts
> Sent: Wednesday, December 08, 2004 9:36 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] GUIDs as Primary/Foreign Keys
> 
> > GUIDs are hard to guess when someone is hacking a URL or form
> > field.  They are random, for all intents and purposes.  GUIDs
> > take a bit more storage as well, if that is an issue.
> 
> In addition, GUIDs make replication easier. SQL Server identity columns
> don't travel too well.
> 
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> phone: 202-797-5496
> fax: 202-797-5444
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
> 
> An archive of the CFCDev list is available at www.mail-
> [EMAIL PROTECTED]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
[EMAIL PROTECTED]

Reply via email to