|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Way to check when a record was last updated without using a date field?Is there a way to check when a record was last updated without using a date
field? Cheers, Cain. SQL server does not keep any audit trail regarding the data updations or
insertions. You have to track it manually either using trigger or from front-end. -- Show quoteRegards, Harsh Athalye "Nothing is impossible" "Cain" wrote: > Is there a way to check when a record was last updated without using a date > field? > Cheers, > Cain. > > > Trigger or Timestamp
Show quote "Harsh Athalye" <HarshAtha***@discussions.microsoft.com> wrote in message news:7E3FE3B6-A963-4670-AC05-B0A4C954E98F@microsoft.com... > SQL server does not keep any audit trail regarding the data updations or > insertions. > You have to track it manually either using trigger or from front-end. > -- > Regards, > Harsh Athalye > "Nothing is impossible" > > > "Cain" wrote: > >> Is there a way to check when a record was last updated without using a >> date >> field? >> Cheers, >> Cain. >> >> >> Immy:
Instead of TIMESTAMP, don't you mean CURRENT_TIMESTAMP? Vern Rabe Show quote "Immy" wrote: > Trigger or Timestamp > > "Harsh Athalye" <HarshAtha***@discussions.microsoft.com> wrote in message > news:7E3FE3B6-A963-4670-AC05-B0A4C954E98F@microsoft.com... > > SQL server does not keep any audit trail regarding the data updations or > > insertions. > > You have to track it manually either using trigger or from front-end. > > -- > > Regards, > > Harsh Athalye > > "Nothing is impossible" > > > > > > "Cain" wrote: > > > >> Is there a way to check when a record was last updated without using a > >> date > >> field? > >> Cheers, > >> Cain. > >> > >> > >> > > > Just to clarify SQL Server does keep an audit trail in the form of a
transaction log. But this is of no use to you in the context of your issue. Show quote "Harsh Athalye" wrote: > SQL server does not keep any audit trail regarding the data updations or > insertions. > You have to track it manually either using trigger or from front-end. > -- > Regards, > Harsh Athalye > "Nothing is impossible" > > > "Cain" wrote: > > > Is there a way to check when a record was last updated without using a date > > field? > > Cheers, > > Cain. > > > > > > That's not a very reliable form of an Audit trail.
In some situations, the Transaction log may be backed up and truncated hourly (or even more frequently). That most certainly doesn't allow for any significant 'auditing'. Even considering the Transaction Log as a audit source (that is, by itself, without other working processes) is just plain misleading. -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "NH" <N*@discussions.microsoft.com> wrote in message news:385766E0-4A9D-4C15-88A0-ACBDBA628662@microsoft.com... > Just to clarify SQL Server does keep an audit trail in the form of a > transaction log. But this is of no use to you in the context of your > issue. > > "Harsh Athalye" wrote: > >> SQL server does not keep any audit trail regarding the data updations or >> insertions. >> You have to track it manually either using trigger or from front-end. >> -- >> Regards, >> Harsh Athalye >> "Nothing is impossible" >> >> >> "Cain" wrote: >> >> > Is there a way to check when a record was last updated without using a >> > date >> > field? >> > Cheers, >> > Cain. >> > >> > >> > Yes, it would depend on the circumstances. And actually I forgot that
non-logged operations would not be included. So scrub my comments. The transaction log while offereing a certain degree of auditing is not comprehensive. Show quote "Arnie Rowland" wrote: > That's not a very reliable form of an Audit trail. > > In some situations, the Transaction log may be backed up and truncated > hourly (or even more frequently). That most certainly doesn't allow for any > significant 'auditing'. > > Even considering the Transaction Log as a audit source (that is, by itself, > without other working processes) is just plain misleading. > > -- > Arnie Rowland, Ph.D. > Westwood Consulting, Inc > > Most good judgment comes from experience. > Most experience comes from bad judgment. > - Anonymous > > > "NH" <N*@discussions.microsoft.com> wrote in message > news:385766E0-4A9D-4C15-88A0-ACBDBA628662@microsoft.com... > > Just to clarify SQL Server does keep an audit trail in the form of a > > transaction log. But this is of no use to you in the context of your > > issue. > > > > "Harsh Athalye" wrote: > > > >> SQL server does not keep any audit trail regarding the data updations or > >> insertions. > >> You have to track it manually either using trigger or from front-end. > >> -- > >> Regards, > >> Harsh Athalye > >> "Nothing is impossible" > >> > >> > >> "Cain" wrote: > >> > >> > Is there a way to check when a record was last updated without using a > >> > date > >> > field? > >> > Cheers, > >> > Cain. > >> > > >> > > >> > > > > From BOL..."The transaction log is a serial record of all modifications that
have occurred in the database as well as the transaction that performed each modification" Show quote "NH" wrote: > Yes, it would depend on the circumstances. And actually I forgot that > non-logged operations would not be included. > > So scrub my comments. The transaction log while offereing a certain degree > of auditing is not comprehensive. > > "Arnie Rowland" wrote: > > > That's not a very reliable form of an Audit trail. > > > > In some situations, the Transaction log may be backed up and truncated > > hourly (or even more frequently). That most certainly doesn't allow for any > > significant 'auditing'. > > > > Even considering the Transaction Log as a audit source (that is, by itself, > > without other working processes) is just plain misleading. > > > > -- > > Arnie Rowland, Ph.D. > > Westwood Consulting, Inc > > > > Most good judgment comes from experience. > > Most experience comes from bad judgment. > > - Anonymous > > > > > > "NH" <N*@discussions.microsoft.com> wrote in message > > news:385766E0-4A9D-4C15-88A0-ACBDBA628662@microsoft.com... > > > Just to clarify SQL Server does keep an audit trail in the form of a > > > transaction log. But this is of no use to you in the context of your > > > issue. > > > > > > "Harsh Athalye" wrote: > > > > > >> SQL server does not keep any audit trail regarding the data updations or > > >> insertions. > > >> You have to track it manually either using trigger or from front-end. > > >> -- > > >> Regards, > > >> Harsh Athalye > > >> "Nothing is impossible" > > >> > > >> > > >> "Cain" wrote: > > >> > > >> > Is there a way to check when a record was last updated without using a > > >> > date > > >> > field? > > >> > Cheers, > > >> > Cain. > > >> > > > >> > > > >> > > > > > > > Hi,
Best way is to include a Createddate and Modifieddate with default set to Getdate() to your table and in your Insert and Update stored procedure update these columns with current date (Getdate()). Thsi will overcome a trigger usage. Thanks Hari SQL Server MVP Show quote "Cain" <C***@Kookoo.net> wrote in message news:F9zJg.97946$fV1.10006@fe1.news.blueyonder.co.uk... > Is there a way to check when a record was last updated without using a > date field? > Cheers, > Cain. > |
|||||||||||||||||||||||