Monday, December 9, 2013

SQL Server : Extracting Data From VSS to SQL Server

Recently, when I was looking to generate some reports for sql files we have in Visual SourceSafe (VSS), I have decided to extract data from VSS to SQL Server, where I can play with data, more easily. 
One tool (off course free) I found which can help for this extraction. This tool  V2M is free to download but works better with less files/no of labels on VSS.
In my case it was not that helpfull and I have to use built in reports from VSS to extract data to text and then to SQL Server, as following.

1-On VSS, open your project, move to your desired folder, right click on it, and then click "Show History"


2- On Project History Options, check on "Recursive" and "Include file Histories" to get versions history for each file and hit OK button
3- It will take time to generate history. Once history page is open hit "Report" button and select "File" as report destination and press OK. It will ask location for file, provide and hit save button.
4- Generated report would be in text format and obviously NOT so simple to export to SQL Server, but not that tricky. You can copy paste whole text to Excel to format it manually and it would take more less time.

2 comments:

  1. Well-written article, Simple and Easy to understand. Thanks
    Question: You mentioned 'You can copy paste whole text to Excel to format it manually and it would take more less time.'
    so please tell me, approximately how much time will it take to manually format a 1 GB data file?

    ReplyDelete
  2. Thanks Qaiser, for your input. Basically on excel sheet you just need four formula cells to format your data in 4 columns (FileName, UpdatedBy, UpdatedDateTime, Action (Added/Checked In)). Remaining, is just replicating these formula cells to whole of your sheet, and you are done. :)

    ReplyDelete

All suggestions are welcome