February 2, 2002 at 8:22 am
Hi...
It is possible, yes, to pass a variable to a Trigger -- is it not?
Jim
February 2, 2002 at 8:34 am
If you mean pass a parameter to a trigger, no. Triggers are fired automatically by SQL Server and are not called by the user. What are you trying to do? Perhaps there's another way.
K. Brian Kelley
http://www.sqlservercentral.com/columnists/bkelley/
K. Brian Kelley
@kbriankelley
February 2, 2002 at 8:37 am
Ummm...
Say you wish to create a Trigger that fires at a certain time of the day. Based on the number of visitors you've had at your site, a variable called "Visitors" has a number of say 135. When that Trigger fires, it passes that var name and value (Visitor:135) to a field in your dbase....or in an email...or whatever.
Can this be done?
Jim
February 2, 2002 at 8:47 am
You are wanting to create a SQL Server job then through SQL Server Agent. You can have job steps that call stored procedures and the like. Here's the Books Online section describing jobs:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_automate_7awj.asp
A trigger is a special stored procedure attached to a particular table. Triggers can fire on one of three operations: INSERT, UPDATE, and DELETE. A trigger can be defined to fire on 1, 2, or all 3 operations, and you can have multiple triggers attached to a table. They fire when the operation they are set to occurs on the table. Here's the information on creating triggers:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_create2_7eeq.asp
K. Brian Kelley
http://www.sqlservercentral.com/columnists/bkelley/
K. Brian Kelley
@kbriankelley
February 3, 2002 at 8:14 am
Thanks bKelly....
Very helpful info...as I'm new to SQL2000, please pardon my 'newbieness...'
Jim
February 3, 2002 at 9:27 am
February 4, 2002 at 4:10 pm
Jim,
Where is this counter variable value? SQL Server Agent is the best scheduling program I've had the pleasure to work with, but, it does not have access to variables on your web server. If that's where your counter is, you'll have to pass the counter value from there to SQL Server via a stored procedure. This procedure can then send the email and etc.
Good luck,
John
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply