On 10/28/05, Charles Harvey III <[EMAIL PROTECTED]> wrote: > I just ran a little test on this query. > My test, wipe out all the data. I am inserting into 3 tables when > a user takes a quiz. Each had close to or over a million rows. So, > I wiped 'em out. Than ran it again. Works like a charm. > > Something in the insert is making it take minutes to commit. And, I > think it is the @@IDENTITY. > > I have to take a look at the code for the PlatformMsSQLServerImpl. > But from looking at the sql profiler I can see that when it does an > insert it also selects the "@@IDENTITY AS id" so that it can return > the id to the newly created object. > > For some reason, that @@IDENTITY part takes minutes when there are > close to a million rows. This is probably a SQL Server problem and > not an OJB problem. But, does anyone have an idea on how I could > get around this problem?
If you have an Sql Server 2000, you could try the alternatives to @@IDENTITY: http://www.sqlteam.com/item.asp?ItemID=319 e.g. SCOPE_IDENTITY() might be faster ? Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
