December 3, 2010 at 10:07 am
Not table structure, but data.
Any input will be greatly appreciated.
December 3, 2010 at 10:40 am
There are some scripts floating around that do this to some degree, but I like Data Compare from Red Gate or Change manager from Embarcadero.
Both can automatically monitor data and report on or notify when data changes.
December 3, 2010 at 12:41 pm
Triggers can do this... could even call sp_send_dbmail to alert you to the change if you wanted it to.
December 3, 2010 at 12:45 pm
SQL ORACLE (12/3/2010)
Not table structure, but data.Any input will be greatly appreciated.
Hi
If your table is having datetime field then you can use order by datetime desc
or if you dont have the datetime field then add new column
ALTER TABLE MYTABLE ADD date DATETIME
go
ALTER TABLE dbo.MyTABLE ADD CONSTRAINT
DF_MyTABLE_date DEFAULT GETDATE() FOR date
Which will help future rows, but is not going to tell when rows that are already in the table were created.
or Try with trigger
Even thgouh you need when the data has been added then try below things
Use 3rd party Tool log Rescue (if you u have from beginning) and find date and time row by row record inserted in your table you will be getting. If You need older datas date and time(when it has been modified) then do it one by one as it in Log file.
If you or not having Log then just leave it no other way is there to get when data inside a table.
Thanks
Parthi
Thanks
Parthi
December 3, 2010 at 12:48 pm
You can also make use of Change Data Capture in SQL Server 2008.
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
December 3, 2010 at 2:06 pm
There's a whole article on it here:
http://www.sqlservercentral.com/articles/Auditing/63247/
http://www.sqlservercentral.com/articles/Auditing/63248/
I think the articles are awesome. But I wrote them, so I may not be completely objective about that. 🙂
If you read the articles, make sure to also read the discussions. Lots of good data there that adds a lot to the subject.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
December 3, 2010 at 4:33 pm
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply