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
 Transact-SQL (2000)
 SQL Server trigger

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-15 : 19:46:41
Patrick writes "Hi,

Maybe easy, maybe not.
We're working on a tight program and need to set an SQL
Server trigger on the database. We need to check if a STARTDATE is greater than an ENDDATE. Both are DATE columns in the same table.

We need something like

IF EXISTS
SELECT * FROM TABLE WHERE STARTDATE > ENDDATE

THEN GOTO DO_ROLLBACK

...
:DO_ROLLBACK
<ROLLBACK CODE>
...

We are stuck on the "do rollback" issue.
What's the SQL server syntax for such a thing?

Many many thanks,

Patrick"
   

- Advertisement -