Visual Studio Team System 2010(Source Control) - Mass code replacement

Posted on 2011-04-22
Last Modified: 2012-05-11

We use Visual Studio Team System 2010(Source Control) to check-in code in our company. I need to replace a table name with a view name in 500 files that reside in the server and check them in. Currently I have to individually check-out each file, replace the table name with the view name and then check them in. This is a very time consuming/tedious/  process.
Is there any more efficient, reliable way through which this job can be achieved?
Question by:dbaner2
    LVL 74

    Accepted Solution

    IIRC, you should be able to do a Find/Replace on the entire solution. After the replace, check-in the solution and it should recursively check-in all files below it that were modified.
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    During the Find/Replace, I believe everything will be checked-out accordingly.

    Author Comment

    Thanks. I will try doing it and let you know. I will try on a test Solution first. Cant take the risk on the main production files.
    LVL 28

    Expert Comment

    by:Ryan McCauley
    The beauty of having everything checked into source control is that you *can* risk it, since you can always undo your changes before check-in if you make a mistake ;)

    If it's all in a single solution, kaufmed's suggestion is the best. If they're spread across different solutions that you can't open them at once, I'd do the find/replace as he suggests, but then use the Visual Studio source control explorer to check in the changes - that way, you can do it all at once, in bulk, and associate that change with a single changeset for all your projects/solutions. If you check-in each solution on its own, then it makes a rollback or the history much more confusing in case you need to make any related changes in the future.


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    746 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

    18 Experts available now in Live!

    Get 1:1 Help Now