Try using the jtds drivers instead. I have not used a trigger to do
this though so its just another driver you might try. I dislike the
SQL drivers shipped with MX and would recommend finding different
drivers.
Adam H
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
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212371
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54