Reply to Re: Equivalent to SQL Anywhere GET_IDENTITY?

Your name:

Reply:


Posted by Jim C on 11/29/06 15:32

Erland Sommarskog wrote:

> Hey, you asked a question, and I gave you the answer that best fitted
> what you was asking for. I also pointed out that it was not thing you
> could really use.

So, you knowingly gave me an unusable answer, hmm. Ok. Thanks, I
guess. :-] And I disagree, it did not fit what I was asking for.
Using ident_current() in the way you suggest would be dangerous in a
multi-user application, which this application is.

No hard feelings? I'm very glad there's a community here willing to
answer my poorly explained, newbie-ish, corner-case questions!

> There is a completely scalable alternative, though, if you are in need
> of that: newid(). newid() returns a GUID, and you can retrieve as many
> you want in advance. On SQL 2005 there is also newsequentialid() which
> guarantees that your GUIDs are generated sequentially, which is good
> to avoid fragementation in the primary key index.
>
> But since a GUID is 16 bytes, it comes with a space cost.

Thanks for that. I had a look at GUIDs, but as you say the cost of the
size is too high, since our application doesn't typically have enough
users at a site to warrant using them. Not to mention reworking a
couple hundred places in the code and the thought of support
complaining they can't find the children of a parent record easily
enough. :-)

Regards,
Jim

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация