I guess one could even combine an instead of trigger and a check constraint. That allow for
"catching the criminal" and making sure that data isn't corrupted. But one would have to write
the triggers, and write them correctly, of course :-)
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...
> Hej Henrik,
> If the columns are never supposed to have a negative value, I'd suggest a
> CHECK for it. This will prevent the error from occuring again. Other than
> information from sysprocesses, when negative values appear.
> Andrs Taylor
> > Hi,
> > I'm having quite a strange problem with my SQL Server installation.
> > Somehow values in a field becomes negative, which they should never be.
> > same operation seems to apply to all records in the database, but I'm not
> > certain of that. The application consists of both asp.net pages and a c++
> > program, and I don't know in which part the error is or where it could be.
> > Is there any way of tracking this error on the database level? For
> > setting up some watchdog or trigger that reports the last SQL statement
> > when the values becomes negative? or some other way to find the error?
> > It's running SQL Server 2000 Enterprise edition with SP2.
> > Thanks,
> > Henrik