The eternal database question.

    Date: 02/17/06 (SQL Server)    Keywords: sql

    In your opinion, should a table's clustered index be the primary key? Always? Never? Under certain conditions? When? Why or why not?

    If it's not the primary key, what are your rules for determining which index should be clustered?

    EDIT: I'm actually going to use this to ask a real queston, too. In SQL Server 2000.

    I have a table with roughly 5,500 lines, which means I don't want to do this manually. The data is concatenated from two different tables, so the ID field has a number of duplicates. What I'd like to do is wipe out the data in the ID column (which is arbitrary) and have the system bulk assign IDs when I set the column to identity. I've tried about twenty different ways to do this with no success. various rand() functions are moving far too fast for me to get different values (and nothing else in the table is unique, or close enough to it, for me to use as a more random seed than millisecond).

    Is there any way to get SQL Server to bulk-assign identity column values, so I can get done with this and move on? Thanks.

    Source: http://community.livejournal.com/sqlserver/43610.html

« Apex SQL Edit || The eternal database question. »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home