A trigger is like a sneaky piece of code that lurks in the bowls of the
database. It is 'triggered' when a particular satement is executed... Like
an insert, delete or update there is also the 'instead of' trigger too. The
trigger itself is an actual query that does something, like copy some data
to some other table or update a counter... Whatever. The application
(coldfusion,php...) doesn't even need to know of its existence. You do need
to create the trigger in the db using create trigger syntax. You could
always create a cftransaction and put some code (query) before or after your
delete, but that is overhead on the cfserver. Read the docs pertaining to
triggers, they are very usefull for many things and in general good to know
about.

Good luck,

Alexander Sicular
Chief Technology Architect
Neurological Institute of New York
Columbia University
as867 [at] columbia {dot} edu


|-----Original Message-----
|From: Jason Davis [mailto:[EMAIL PROTECTED]] 
|Sent: Thursday, February 28, 2002 6:27 PM
|To: CF-Talk
|Subject: Re: count delete
|
|
|I'm sorry, how will triggers help?
|
|----- Original Message -----
|From: "Sicular, Alexander" <[EMAIL PROTECTED]>
|To: "CF-Talk" <[EMAIL PROTECTED]>
|Sent: Friday, March 01, 2002 1:17 AM
|Subject: RE: count delete
|
|
|> Use an instead of trigger. Check the books online for mssql. Search 
|> for create trigger.
|>
|> Good luck,
|>
|> Alexander Sicular
|> Chief Technology Architect
|> Neurological Institute of New York
|> Columbia University
|> as867 [at] columbia {dot} edu
|>
|>
|> |-----Original Message-----
|> |From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
|> |Sent: Thursday, February 28, 2002 6:11 PM
|> |To: CF-Talk
|> |Subject: count delete
|> |
|> |
|> |How can I find out wheter rows were deleted in a db or not?
|> |
|> |DELETE from Orders WHERE
|> |Product_id=(SELECT TOP 1 Product_id from Product WHERE
|> |Product_coupon='foo1')
|> |
|> |I would like to know how much records were deleted, if any.
|> |
|> |I tried using this at the end of the query with no luck:
|> |
|> |SELECT @@ROWCOUNT AS Deleted
|> |
|> |and then trying to cfoutput > #Queryname.Delete# (no such variable) 
|> |:(
|> |
|> |Any help?
|> |
|> |
|> |
|> 
|
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to