How to perform better document version control on Excel files and SQL schema files

version control sql scripts
free sql source control
redgate sql source control best practices
sql database version control
sql source control git
visual studio sql source control
tfs source control for sql server
bitbucket sql server source control

I am in charge of several Excel files and SQL schema files. How should I perform better document version control on these files?

I need to know the part modified (different part) in these files and keep all the versions for reference. Currently I am appending the time stamp on the file name, but I found it seemed to be inefficient.

Is there a way or good practice to do better document version control?

By the way, editors send me the files via email.

Since you've tagged your question with git I assume you are asking about Git usage for this.

Well, SQL dumps are normal text files so it makes perfect sense to track them with Git. Just create a repository and store them in it. When you get a new version of a file, simply overwrite it and commit, Git will figure out everything for you, and you'll be able to see modification dates, checkout specific versions of this file and compare different versions.

The same is true for .xlsx if you decompress them. .xlsx files are zipped up directories of XML files (See How to properly assemble a valid xlsx file from its internal sub-components?). Git will view them as binary unless decompressed. It is possible to unzip the .xlsx and track the changes to the individual XML files inside of the archive.

You could also do this with .xls files, but the problem here is that .xls format is binary, so you can't get meaningful diffs from it. But you'll still be able to see modification history and checkout specific versions.

Version Control for Excel Spreadsheets, . Click the 'Commit Changes' button > A dialogue box will open. This type of version control can be basic, like v1, v2, v3 based on a document being manually approved, or it can be entirely dynamic and granular (like the document version control example you see below), which features every chance and 'event' which has occurred to that original document - which is known as an audit trail.

The answer I have written here can be applied in this case. A tool called xls2txt can provide human-readable output from .xls files. So in short, you should put this to your .gitattributes file:

*.xls diff=xls

And in the .git/config:

[diff "xls"]
    binary = true
    textconv = /path/to/xls2txt

Of course, I'm sure you can find similar tools for other file types as well, making git diff a very useful tool for office documents. This is what I currently have in my global .gitconfig:

[diff "xls"]
    binary = true
    textconv = /usr/bin/py_xls2txt
[diff "pdf"]
    binary = true
    textconv = /usr/bin/pdf2txt
[diff "doc"]
    binary = true
    textconv = /usr/bin/catdoc
[diff "docx"]
    binary = true
    textconv = /usr/bin/docx2txt

The Pro Git book has a good chapter on the subject: 8.2 Customizing Git - Git Attributes

Using git for version control of spreadsheet models, This article explains how SQL database source control can help in version control SQL These scripts could be any of the following, and more each time a new build is created from source control; A configuration file that could be run to update How to Import and Export SQL Server data to an Excel file  XLTools Version Control add-in for Excel workbooks is a revision control, or a source control tool. It helps track changes to Excel files and gives a clear picture of who, how and when modified the document.

xlwings/git-xl: Git extension: Makes git-diff and git-merge , There are tools like ApexSQL Source Control, which integrate with SSMS and VS how a system including a SQL Server database schema compare tool, (for both the database and the repository) of an ApexSQL Diff project file find out more about How to work with SQL database source control labels. Non-Software Version Control for Documents. If you don’t have software that can do it for you, you can control your document versions manually. Add a table to the front of the document that says the version, the author, a brief summary of changes in that version and the date.

Tante made it very simple in Managing ZIP-based file formats in Git:

Open your ~/.gitconfig file (create if not existing already) and add the following stanza:

[diff "zip"]

textconv = unzip -c -a

How to version control SQL scripts alongside SQL database objects, though most should work on later editions, as well as on SQL Server 2005. define the schema objects and other code is not the whole story. whether that file is a Word document, Excel spreadsheet, C# source code, or database script file. A version control system serves the following purposes, among others. Version control enables multiple people to simultaneously work on a single project. Each person edits his or her own copy of the files and chooses when to share those changes with the rest of the team.

We've built an open-source Git command line extension for Excel workbooks: https://www.xltrail.com/git-xltrail.

In a nutshell, the main feature is that it makes git diff work on any workbook file formats so that it shows the diff on the workbook's VBA content (at some point, we'll make this work for the worksheets content, too).

It's still early days but it might help.

How to keep a source control repository updated with the latest SQL , If you are a Microsoft Shop, SQL Server could also work. If you wish to load Documents .docx and .xlsx files into a MySQL Database, same source, however version control procedures would be followed to maintain However, every database was then restructured to follow the XML schema that then  #1) Git. Git is one of the best version control tools that is available in the present market. Features. Provides strong support for non-linear development. Distributed repository model. Compatible with existing systems and protocols like HTTP, FTP, ssh. Capable of efficiently handling small to large sized projects.

[PDF] SQL Server Source Control Basics, Link SQL Server databases to SVN, TFS, Git, Perforce, Mercurial with powerful SSMS add-in - dbForge Source Control for SQL Server. Try for free now! Method 1: Connect to the server by using Object Explorer in SQL Server Management Studio. After Object Explorer is connected, it will show the version information in parentheses, together with the user name that is used to connect to the specific instance of SQL Server.

Best database to store and retrieve Word and Excel documents , The following is an example walkthrough of importing an Excel document into To run this tutorial you will need an Excel file, and admin access to a running some versions of MySQL for the data loading we'll do in the following steps. Next we'll define the schema for our boat table using the CREATE TABLE command. Drag and drop - Using your mouse, drag the file from where it's currently located and drop it on the Teams window among the files. Upload - Select Upload,then select the file (or files) you'd like to upload, and select Open. Any files you upload will be accessible by any member of your team.

SQL Source Control Plugin for SSMS with Git, TFS, SVN Support, There are several ways to import data from Excel files to SQL Server or to A complete description of complex tools and services like SSIS or Azure To learn more about the solution that interests you, follow the provided links. Studio installed, see Download SQL Server Management Studio (SSMS). How does versioning work with file checkout? When you check out a file from a library that has versioning turned on, a new version is created every time you check it back in. And, if major and minor versions are turned on, you can decide, at check-in, which type of version you are checking in.

Comments
  • I may convert these Excel files into CSV files, and then track them using git so that I can use diff to see the modification. Is there any other good practice?
  • See the other answers, which I think are better than the one you accepted.
  • Yes, I know git. I think git is good when tracking SQL schemes. As for Excel files (.xlsx and .xls), because they are binary files, tracking them using git cannot show me what has been modified in human perspective. This is what I'm confusing.
  • @MarcusThornton .xlsx is XML, so should work fine. In general, there is no way to easily compare two .xls files. You probably could add a pre-commit hook that will put a .csv near it and you'll be able to diff those.
  • it doesn't work for me on windows7. i've downloaded the catdoc verion for Windows from here: blog.brush.co.nz/2009/09/catdoc-windows than edit gitconfig and attributes as described above. but i still get: diff --git a/src/Reports/src/main/etc/templates/nbcu.xls b/src/Reports/src/main/etc/templates/nbcu.xls index 2476319..1daec86 100644 Binary files a/src/.../test.xls and b/src/.../test.xls differ GIT version: 1.7.6.msysgit.1
  • Is it still storing the doc as a doc file or as a text file? If it's a text file, how do you recover the doc?
  • @CMCDragonkai This has no effect on how the file is stored, only the output of diff command is affected.
  • So it's still storing the entire file, not the diffs?
  • Re: xls2txt: extremely reluctant to install a closed-source tool from a Polish website. This might be the same thing? github.com/hroptatyr/xls2txt No README though...
  • I actually haven't tried, but I assume it would - if you do give that a try it would be great to know
  • @JonG I can't get it to work with LibreOffice and there's no Issues tab in the bitbucket repository. I'd love to contribute if we could get an issue going!
  • Hi @christian-droulers, I've enabled issue on the Repo, feel free to add something there!
  • @JonG This looks great, having a diff-able version history could be really useful in a lot of document related scenarios! But why is it important that the file opens in Excel? Can't you just use the .orig file? And do you think the normalizations can be configurable/dynamic so that the code can be used for docx/pptx as well?
  • then, Peng Xu extended the solution, allowing to versioning zip-based files using filter, in addition to only view diff changes: tante.cc/2010/06/23/managing-zip-based-file-formats-in-git/…