See last changes in sqlserver

This is probably a novice question but I cannot find it: Say you are 
debugging a program, you replay the error, and you want to see which 
database files are effected, how can you see that? Is there a way to get the 
latest changed date for a entity, is there a log file where you can see 
which statements where executed the last five minutes? For example my 
database exist out of  customer, product, order, company files/entity I want 
something like

file            updated
customer  17-05-2010
product    17-05-2010
order        05-05-2010
company  17-05-2010

And then conclude: "Order is not modified, but I expected it would"

Jalisey Reloj 

0
Marc
5/17/2010 6:21:02 PM
sqlserver.programming 1873 articles. 0 followers. Follow

3 Replies
422 Views

Similar Articles

[PageSpeed] 17

Your best option is probably to add a LastModified datetime column with a 
default value of GetDate() to all of your tables and use an update trigger 
to update this value whenever a record is changed.  See for example:

http://sqlserver2000.databases.aspfaq.com/how-do-i-audit-changes-to-sql-server-data.html

After that, a little script can give you what you want, for example:

select 'customer' as file, (select max (LastModified) from 'customer') as 
Updated from customer
Union All
select 'product', (select max (LastModified) from 'product') from product
....

-- 
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server 
(French)


"Marc" <norddddly@cddd.be> wrote in message 
news:uqAR22e9KHA.3880@TK2MSFTNGP04.phx.gbl...
> This is probably a novice question but I cannot find it: Say you are 
> debugging a program, you replay the error, and you want to see which 
> database files are effected, how can you see that? Is there a way to get 
> the latest changed date for a entity, is there a log file where you can 
> see which statements where executed the last five minutes? For example my 
> database exist out of  customer, product, order, company files/entity I 
> want something like
>
> file            updated
> customer  17-05-2010
> product    17-05-2010
> order        05-05-2010
> company  17-05-2010
>
> And then conclude: "Order is not modified, but I expected it would"
>
> Jalisey Reloj 


0
Sylvain
5/17/2010 6:40:25 PM
Marc (norddddly@cddd.be) writes:
> This is probably a novice question but I cannot find it: Say you are 
> debugging a program, you replay the error, and you want to see which 
> database files are effected, how can you see that? Is there a way to get
> the latest changed date for a entity, is there a log file where you can
> see which statements where executed the last five minutes? For example
> my database exist out of  customer, product, order, company files/entity
> I want something like 
> 
> file            updated
> customer  17-05-2010
> product    17-05-2010
> order        05-05-2010
> company  17-05-2010
> 
> And then conclude: "Order is not modified, but I expected it would"
 
Not really. There used to be log readers from third-party vendors that
could help you to get this information from the transaction log. But
it does seem that these products are thriving.  Lumigent were the first,
but they seem to be into other things. Log PI is defunct. I think Apex
have one.

What you can to is to set up a trace to caputure statements, but the
information you will capture there will be too diverse and difficult
to use and analyse for this purpose.


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

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0
Erland
5/17/2010 9:45:19 PM
"Erland Sommarskog" <esquel@sommarskog.se> schreef in bericht

> Marc (norddddly@cddd.be) writes:
>> This is probably a novice question but I cannot find it: Say you are
>> debugging a program, you replay the error, and you want to see which
>> database files are effected, how can you see that?

> Not really.

I have used the logfile of the application and write a string everytime it 
comes in the module that invokes the SQL, that seems to be the best option. 

0
Marc
5/20/2010 5:08:55 PM
Reply:

Similar Artilces:

Change AD User Password
I am not AD admin. Give a user's current password, how to change his/her password in powershell? Thanks The easiest way is using either the quest cmdlets or the ad powershell module. example using ad powershell's Set-ADAccountPassword cmdlet: Set-ADAccountPassword johndoe -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force) example using quest's Set-QADUser cmdlet: Set-QADUser johndoe -UserPassword "p@ssw0rd" "Ben" wrote: > I am not AD admin. Give a user's current password, how to change his/...

I cant see emails coming in anymore.
I used to push send/receive and a box would come up telling me 'Receiving 8 of 40 emails' with a green bar going across the centre. Once the emails are received the box goes. If I push send/receive nothing happens. If I push it say, 10 times, again nothing happens. Once all the emails are thru the box that used to come up, than flashes up 10 times, but by than its a little late. Does anyone know how to get the box back? I would really appreciate it... KR Mick. I send this message using the forward procedure to somebody of the group My problem is likely the same as a lot ...

pls give me some document about changing application's skin
i want to change the skin of vb application through hook,any one can give me some document, thanks a lot daniel wang You should make a quick search in google.com on how to define a WindowProc for the form you want to change, then handle WM_NCPAINT and WM_NCCALCSIZE to set skin dimensions and draw the skin. Use GetWindowDC() to get a device context of the whole window including the non-client area - that's where you want to draw. Have fun, Daniel C. Gindi danielgindi (at) gmail dot com "ws" <shengwang2000@126.com> wrote in message...

Not able to see all data but can see on another computer
Hi, I am using SAP application and if i retrive the excel file from SAP i can see only 48 lines where as i should see 110 lines but if i opened that same excel file in another computer then i can see all lines (110 Lines) i don't know why its happening. Can anyone help on this? Thanks in advance. Regards, Harish ...

How do I change a field size?
I have a number of tables which have a text field of the same name. It is used to hold a record reference number and links the tables together in queries. Currently it is 15 characters long but I want to increase it to 20. If I try and do it in table design I get a message that says it is used to link tables in a relationship and I must delete the relationship first. Is there anyway I can do this rather than opening dozens of queries, deleting the relationship, change the field size then open all the queries again to re-create the relationship? I tried opening the Relationship window bu...

Change Backend to Frontend Server Questions
I started out with one exchange 2003 backend server - clients connect to this via RPC- https and pop3. I have now installed a second 2003 enterprise backend server and will be moving all mail boxes and public folders to it then converting the original server to a frontend server. My questions are; 1. Should continue to I deliver incoming SMTP to the FE server after the change? 2. Does it matter that the FE server is the PDC and the first Exchsrvr 3. Should Pop3 clients collect mail via the FE server? I have read the FE BE Topography guide but there is not much information on re-assign...

Query to Access : does'nt see tables
Office 2000 SP3 FR From Excel / MS Query, I want to read data in Access tables. I choose the mdb file and so MS Query displays this error message (translated) : "This data source does'nt have any visible table". Original in French : "Cette source de donn�es ne contient aucune table visible." I transfert my data to a new mdb file : it work's few times (!), then the error message appears again. How to resolve this problem ? Jacques. Gotcha ! MS Query does'nt accept a file name with 2 dot inside ! Example : MyFile.mdb --> Ok My.File.mdb --> "...

Sort First and last name in single cell
I have a mailing list of over 10,000 names, with the first name and las name in a single cell. The first name is listed first. Is there a wa to sort the column by last name or better yet isolate the last name t a separate column so I can merge the data to a different application Thank you in advance for your help. : -- Message posted from http://www.ExcelForum.com Rpielet, there's no way to sort by last name, given the way your data is entered. Instead, use the Text to Columns command on the Data menu to put first and last names in separate columns. It's very intuitive. Check it out...

Different Last Page on Form
Is there a way to have a form print a completely different last page? I need to have the system print a Terms and Conditions page for every purchase order. It is a complete page worth of legal jargon. So I need it to print the order clean and then on the last page to print the Ts&Cs. I do not know a way to do this within GP report writer without customization - you may want to use SRS or some other reporting tool. I believe next release of GP will have reporting available thru MS Word. On Sep 25, 11:18=A0am, AllenMc <Alle...@discussions.microsoft.com> wrote: > Is there a way ...

conditionally changing cell color based upon value
With Excel 2003... 1) is it possible to change the cell color to yello for the top 10 percent of cell values in a column? I have a column of numbers and I want the biggest 10 percent of those numbers to stand out? I don't want to play with conditional formatting "greater than" to find the >X value that will make just 10 percent of the cells change to yellow? 2) is it possible to change the color of the next cell over? Instead of those yellow cells being yellow on the value, I would prefer to make the item name (like a product name -- text) be yellow even though the cel...

Change the Range of a Name
Is There a possibility, to change the Range of a name-dependent of the value of a Variable(perhaps Startrow rsp. Endrow)-with with a VBA-statement? Thank you for a good hint! dim Startrow as long dim endrow as long with activesheet .range(.cells(startrow,"B"),.cells(endrow,"c")).name = "myName" end with if myName already exists, this'll reassign it. If it didn't exist, it'll get created. (Did I misunderstand the question?) "H�lzl Otto" wrote: > > Is There a possibility, to change the Range of a name-dependent of the value &g...

Edit last field without move to next record
How do I edit last field on the form without moving to next record after editing? On Fri, 15 Jun 2007 10:50:45 -0700, Song Su wrote: > How do I edit last field on the form without moving to next record after > editing? Try setting the Form's Cycle property to Current Record -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail ...

my colors change in my workbook when I open another workbook
I downloaded a template for Excel to my computer. When I use the template, the colors in other workbooks change. After I reboot, it all goes back to normal, until I open the template again. ...

Mass Item Database Change
What SQL statement would be used to update every item in the database to turn on barcodes = code 128B ? UPDATE Item SET BarcodeFormat = '7' Rob "Richard" <Richard@discussions.microsoft.com> wrote in message news:1013C7B3-D3B0-48DC-A8E6-1A85E8318D1F@microsoft.com... > What SQL statement would be used to update every item in the database to > turn > on barcodes = code 128B ? Thanks Rob. How do you figure this out? Is there a resource available to me which I could use to answer this question myself? Seems everytime I have a database change need, I don&...

how to change width of label box in pie chart
In EXCEL 2003 (but all versions have given this problem) When making a pie chart with long label names & especially when including other data, (%, & values) the names wrap part to next line. Is there a fix to make the label box wider? The label width is controlled only by Excel, and you can't do much about it. You could use a textbox instead, but it will not move with the pie wedge. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "me@rrc" <me@rrc@discussions.microsoft.com> wrote in message news:A5CB...

How to see my mail queue?
Hi there, I have a Exchange 2000 running on Windows 2000 server. Could you please tell me how to monitor my emails in my mail queue? I can't find a location on the Windows to see the mail queue status. Thanks in advance, Ross To view the mail queues follow these steps: 1. Open system manager, Navigate down to the following location Your organization --> Administrative groups --> Your Admin group --> Servers --> Your Server --> Protocols --> SMTP --> SMTP virtual server --> Queues You should then see all the smtp queues and monitor mail. thanks, J. ...

Locating the last table entry
I have an Access front end linked to sql tables. After a new record has beenadded to a table I need to process some data. I was locating the last newentry by running a query to find the max ID which should be the latest entrysince th id was an autonumber field. I have now modified the system tosynchronise tables and the id is now a GUIID. The query no longer returnsthe last entered record.How can I determine the last entry in an sql table.Thanks.Alex On Mar 15, 11:39 am, "Paradigm" <nos...@hotmail.com> wrote:> I have an Access front end linked to sql tables. After a new reco...

I see you
Well, not really, but I used Google Earth to zoom in on the Flatiron Building. You can get so close you can see the utilities on the roof, the hydrants on the street, the little parkish area across 5th Avenue, etc etc. Cool! Now tell me where your office is (like where is Peter's window, what floor and facing what street). Google Earth lets you zoom in all directions so I'll be able to turn the map to see that window. Silly I know but still a connection on some level. Pats looked good but not great last night. I didn't watch much more of the game. I'm not sold on ...

Change Status Workflow
Is the Change Status workflow rule treated like a Manual workflow in that you have to manually apply the rule - or will it fire autmatically? I am creating a very simple WF but it seems to only work if I apply it manually. Here is my WF: When an Account is created and the AccountRatingCode is set to a certain value [in this case "Premier"] or when the AccountRatingCode is set to "Premier" for an exisitng Account then create a task for the account owner to call that Premier account. Also, will workflows fire on custom schema fields? Change Status only applies to ch...

Date: Today, Yesterday, Last Week -- How do I get rid of these?
I really don't like the different panes Outlook separates when msgs were received. I really takes up a lot of space on an 800x600 screen. I can't seem to find a setting to get rid of it so it's more like Outlook 2000. -- ------------------------------- remove "smooth" from my address. View, Arrange By, Uncheck Show in Groups. -- Patricia Cardoza Outlook MVP Author - Special Edition Using Microsoft Office Outlook 2003 Lead Author - Access 2003 VBA Programmer's Reference Author - Absolute Beginner's Guide to Microsoft OneNote 2003 http://blogs.officezealot.c...

Changing Beginning Page Number
I have a document that begins with page #25. I need to change it to #23, but can't figure out how to do it. Any suggestions? DJ wrote: > I have a document that begins with page #25. I need to > change it to #23, but can't figure out how to do it. Any > suggestions? ==================================== It would be nice to know what program / version you are using but we enjoy guessing so .... Try going to...Insert / Section. -- John Inzer ...

To See or Not To See
I have copied a few tables of text from a web page into Excel. Some of the information contain word that are hyperlinks or email addresses. Is there a way to change those columns of information to reveal the web address or email address? Thanks So is it just displaying plaintext currently? Have you seen this information from the Help Menu? When you make changes to the Hyperlink and Followed Hyperlink styles, your changes apply to all hyperlinks (hyperlink: Colored and underlined text or a graphic that you click to go to a file, a location in a file, a Web page on the World Wide Web...

How can I change the shape of an image inserted into a publisher?
Do you want to do something other than change the height or width? If yes, you won't be able to in Publisher. -- Don Vancouver, USA "Rossman" <Rossman@discussions.microsoft.com> wrote in message news:F011697E-2A9A-4CA2-8964-B9D41BF48DDB@microsoft.com... > Thanks Don. Yeah, I was hoping to be able to bend an edge to add appeal to the image. Not possible huh? "Don Schmidt" wrote: > Do you want to do something other than change the height or width? If yes, > you won't be able to in Publisher. > > > -- > Don > Vancou...

E12 unable to see storage groups through EX MMC
We've been running E12 in a test environment for about 1 month and just today ran into a situation where the storage groups for a server are no longer visible from the console on that machine. If we view the server from a console on a different EX server we see all storage groups and stores. Any help is greatly appreciated Thanks can you list the storage groups and stores from the shell (EMS) on that server? did you try restarting EMC? -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- &quo...

Change format of the date in Visio?
When I want to use the Timline-function in Visio I get disturbed that it isn't possible to change the format of the date for example for an interval or a milestone to the way i want it. I would like it to be "Friday 16/2" instead of the ways that is possible to chose (not written out the month in letter nor the year). Is it possible to change into this easily? Thanks On Sun, 28 Jan 2007 14:27:01 -0800, Smeeed <Smeeed@discussions.microsoft.com> wrote: >When I want to use the Timline-function in Visio I get disturbed that it >isn't possible to change the for...