> > I don't think you can pass a value out from a trigger - once the trigger
> 
> sure you can. you can reference its value in queryName.mytable_ID

But what is the query that queryName refers to?

If you say <CFQUERY...> CREATE TRIGGER...AS SELECT mytable_ID...</CFQUERY>

then what is executed is the CREATE TRIGGER statement, i.e. it stores the
trigger in the database. The trigger only *fires* when a row is inserted.
Are you saying that CF is clever enough to pick up the fact that the
trigger has fired & grab the value from somewhere?

The SQL Server documentation says:

<QUOTE>
Triggers can include any number and kind of Transact-SQL statements except
SELECT. A trigger is designed to check or change data based on a data
modification statement; it should not return data to the user.
</QUOTE>
...
<QUOTE>
To eliminate having results returned to an application due to a trigger
firing, do not include either SELECT statements that return results, or
statements that perform variable assignment in a trigger. A trigger that
includes either SELECT statements that return results to the user or
statements that perform variable assignment requires special handling; these
returned results would have to be written into every application in which
modifications to the trigger table are allowed. 
</QUOUTE>

I think encapsulating it all in a stored proc would be the best thing.

Nick


**********************************************************************
Information in this email is confidential and may be privileged. 
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system. 
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone. 
Thank you for your co-operation.
**********************************************************************
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to