• CirquedeSQLeil (2/6/2010)


    Would a sequential guid work in place of an int?

    Yes, but they have problems of their own. Quite apart from the issues of key width and getting the darn things in some sort of order so your system doesn't disappear in a puff of page-splits, they're horrible to work with. I mean that in a practical sense. Any DBA that has had to use GUIDs a lot gets plenty of practice with copy and paste 😉 It's also tedious typing UNIQUEIDENTIFIER all the time - how much easier is 'INT'?

    These may sound like small objections, and they probably are. I could go on about the technical weaknesses of 'ordered' GUIDs for a while, but I will try to resist the temptation. The everyday irritations are the thing that finally turned me off to GUIDs.

    Jeff knows what's coming next.

    Sequence Tables are a pretty perfect solution for the sort of problem that prompted this thread - if implemented correctly. This was nigh-on impossible to do in SQL Server 2000, but we've had SQL Server 2005 for a while now 😀

    I have written an article on Sequence Tables which I hope will be published here on SSC shortly. Jeff is one of the technical reviewers 😉

    BTW Jason, the second link in your post is now broken 🙁

    Paul