Bert,
I have been returning new identities using triggers for years without any 
problems. It is working for me using CFMX 6.1 and the DataDirect
3.4drivers. I do not see any JRun CPU spike on my server. Are you
suggesting
that everything works without any error messages being generated, but JRun 
seems to consume more CPU than it should? I would be interested to know if 
you are able to find an answer to this problem. I would make sure you have 
applied the latest SQL Server and CFMX service packs / hotfixes. 
 Good luck,
Mike Chabot
 On 7/20/05, Bert Dawson <[EMAIL PROTECTED]> wrote: 
> 
> Years ago i picked up a way of returning the value inserted into an
> Identity column in SQL server, by adding a trigger to that table:
> 
> CREATE TRIGGER get_my_id ON dbo.my_table
> FOR INSERT
> AS
> SELECT my_id AS my_new_id
> FROM INSERTED
> GO
> 
> Then i can run:
> 
> <cfquery name="q_test" datasource="#dsn#">
> INSERT INTO my_table (my_text)
> VALUES ('foo')
> </cfquery>
> 
> my new id = #q_test.my_new_id#
> 
> I know i can use @@IDENTITY or SCOPE_IDENTITY(), but i was wondering
> if the trigger method is a Bad thing to do...
> 
> Its worked from CF4 to CFMX7, but barfs with the DataDirect 3.4
> drivers: the insert happens, but JRun sits at 50%.
> 
> Does that mean there's a bug with the driver, or something wrong with my 
> code?
> 
> Cheers
> Bert
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212344
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to