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

Posted on 2009-02-12
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.
Question by:arvapal
    LVL 22

    Expert Comment

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

    Author Comment


    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.
    LVL 96

    Accepted Solution

    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
    LVL 3

    Assisted Solution

    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:
    LVL 3

    Expert Comment

    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.


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now