Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Creating a Trigger

Author  Topic 

Big KL Hutch
Starting Member

3 Posts

Posted - 2006-11-16 : 08:52:41
I am a fairly new person to SQL. I have a database and want to create a "Trigger" that allows me to see when a person changes a transaction that was already placed into the database. I have developed some aspect of this trigger but need some help in modifying this code.

CREATE TRIGGER dbo.CulpritActions
GO
CREATE PROC dbo.CulpritActions
AS
SELECT * FROM dbo.dbActionsTbl
Where CreateDate < GETDATE () AND InterviewDate >= GETDATE
(00.00.00.00)
Go
What am I missing? I get some data but not specifically the time I want to narrow daown? I want it to narrow and action based on this time signature in miliseconds?

[/purple]

KL Hutch

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-16 : 08:58:02
quote:
What am I missing?

Most of the things? I am surprised it works at all!

Syntax for Create Trigger is :

CREATE TRIGGER <trigger-name>
ON <table>
FOR INSERT, UPDATE
AS
....
GO


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-11-16 : 09:08:10
It doesn't look like you know what a trigger it or what it is used for.

More than likely, what you need is a stored procedure.

If you want any help, you need to explain what you are trying to do.





CODO ERGO SUM
Go to Top of Page

Big KL Hutch
Starting Member

3 Posts

Posted - 2006-11-16 : 09:34:40
Would this be all that I can do with this trigger? Insert, Update? I was under the impression I can use it to determine some sort of actions taking place on a particular table? Is this correct?

KL Hutch
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-16 : 09:41:41
No, you can also catch Delete. What other operations do you expect?


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page
   

- Advertisement -