We help IT Professionals succeed at work.

How to maintain version history in the same file in team foundation server 2008

Medium Priority
Last Modified: 2012-08-14
Hi Experts,

How to maintain version history in the same file in tfs 2008?

Our requirement is to maintain version history / updated date information inside the checkin files (database .sql files) This will help us to track the post deployment issues with respect to database.

This is something similar to Keyword expansion feature in Visual Source Safe. I have seen some articles in google which says, keyword explansion support has been removed in TFS 2008.

Without this feature, i am facing lot of problems in my current project.

But is there any workaround to achieve this?

i have so many hopes in experts exchange EXPERTS

Any kind of hlep is highly appreciable.
Watch Question

Perhaps it's possible using a little PowerShell magic. Some examples that may help:



I have gone through that link, but not exactly the same.

Below is my exact requirement.

I have the database scipts at production, Staging and Testing environment.

Currently, i don't have any version control for the db scripts. Due to that problem, for any issues with respect to the database scripts, i am unable to track the version of that script which  is running at Production or Staging server.

To address that problem, i have to maintain the version history on the top of the script file itself.

So any additional information would be greatly appreciated.
Most Valuable Expert 2012
Top Expert 2008
Yes, you are joining a very large "club" of people that are complaining about that same fact.

Have you seen this blog from Buck Hodges?

Keyword expansion in TFS

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
I'd suggest checking the .sql files into TFS, if you aren't already.  

Then, write a web service that listens for checkins, then re-downloads and checks out the .sql file(s) affected and appends the top of the file with the changeset/date/comment, etc and checks it back in automatically.  

You'd have to be careful that the web service doesn't pick up its own checkins causing an infinite loop of checkins.  This is easily done by having the web service write a specific comment when checking in its change and looking for that comment when acting on checkins.  

It would also result in two checkins for every checked in change (one from the user and one from the web service,) which could cause problems with continuous integration and makes your history look a bit messy.

In fact, TFS 2005 didn't have continuous integration (CI), so the web service here that added CI to TFS 2005 is a decent place to start to figure out how to subscribe to checkin events and act on them:

This question has been answered.  TheLearnedOne provided proof that the feature has been removed in TFS 2008 and I provided a workaround.  There's also other suggestions for workarounds listed in TheLearnedOne's link.  While the workarounds are not simple and I did not provide sample code, I think it deserves a C or B - the question was answered.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.