Discussion: Triggers and Flag bit
Afficher un message
Vieux 26/03/2008, 00h35   #5
Erland Sommarskog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Triggers and Flag bit

Sharif Islam (mislam@spam.uiuc.edu) writes:
> Thanks, the timestamp solution seems feasible. I am little confused on
> how to use it.
>
> According to the documentation SELECT @@DBTS should return the records
> that were just updated or modified. After some updated, when I ran the
> select statement, I am getting all the rows. Is there anything else I
> need to do? When I created the field I just assigned the data type,
> didn't include any default vaule (using MSSQL 2005).


Not sure what you mean here, as SELECT @@DBTS returns a single value.
Probably you ran some other query, but as I don't see it, I can't say
what's wrong with it. :-)

Rather than using @@DBTS, min_active_rowversion() is a better choice.
This function was added in SP2, and it was added to Books Online as late
in the September 2007 edition (see my signature for download link). Looking
at @@dbts can cause some issues when there are uncommitted transaction.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
  Réponse avec citation
 
Page generated in 0,04760 seconds with 9 queries