• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

Log records updated from sql statement

I'm using MS SQL Server 2008 and I need to run an Update Script and I want to log each record that was updated by my script.  Is there a way to turn on a logging feature on a particular file, run the update statement, then turn of the logging and query the logging result?  All of this will be done through MS SQL Server Management Studio.
0
weimha
Asked:
weimha
  • 3
1 Solution
 
chapmandewCommented:
You can use SQL Server Profiler to capture the changes.  Not really clear on exactly what you want?
0
 
DBAduck - Ben MillerPrincipal ConsultantCommented:
You may also turn on Change Data Capture (read up on it in Books Online) and query from that.  But I am also not sure 100% what you are looking to accomplish with the logging.
0
 
chapmandewCommented:
Right, but CDC has to be completely setup for such a thing...not something you can easily turn on and off.
0
 
weimhaAuthor Commented:
I have to run an update statement over my production data and would like a report of the records changed.  
I expect approx 20 records out of a total of 100,000 to be changed, but I would like confirmation that only those 20 were changed.
I was hoping there was something built into SQL Server 2008 that could do this for me easily.
0
 
chapmandewCommented:
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now