Implement a source control for SQL Server Management Studio (SSMS).
Below instructions will help you to implement a source control integration for SQL Server Management Studio (SSMS).
You can launch any Microsoft Windows or Microsoft .NET Framework application from SSMS Tools menu.
More info : https://technet.microsoft.com/en-us/library/ms177402(v=sql.110).aspx
- Any version of Microsoft SQL Server Management Studio (SSMS)
- Git
Execute the following command in your Git bash, this will be used as an input tool, e.g., commit message
git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
| Name | Value |
|---|---|
| Name | &Git commit |
| Command | C:\windows\SysWOW64\cmd.exe |
| Arguments | /c ""C:\Program Files\Git\bin\sh.exe" --login -i -c "git add -A; git commit -e"" |
| Initial directory | $(ItemDir) |
| Name | Value |
|---|---|
| Name | &Git push |
| Command | C:\windows\SysWOW64\cmd.exe |
| Arguments | /c ""C:\Program Files\Git\bin\sh.exe" --login -i -c "git push"" |
| Initial directory | $(ItemDir) |
| Name | Value |
|---|---|
| Name | &Git pull |
| Command | C:\windows\SysWOW64\cmd.exe |
| Arguments | /c ""C:\Program Files\Git\bin\sh.exe" --login -i -c "git pull"" |
| Initial directory | $(ItemDir) |
Customize the Git external tools.
- In SSMS, go to Tools menu, then select Customize...
- In the “Commands” tab, select “Menu bar” in the “Menu Bar” list
- Click in the “Add New Menu” button
- Select “New Menu”
- Click in the “Modify Selection” button
- In the “Modify Selection” box, enter the new menu name e.g. “Git”, and click in the “Begin a Group” button.
- In the “Commands” tab, select "Git" in the "Menu Bar" list
- Click in the “Add Command” button
- Select “External command N”, where N corresponds to the command creation order e.g. "Git commit" command is the "External command 1", then rename it with the corresponding command name.
- Rename each Git command
- The result looks like
- Clone your repository on your computer using "
git clone [<repository>]" - Open your .sql file in SSMS
- Modify and save it
- Commit using "Commit" menu under "Git" menu (This command adds all the modified files and commit them)
- Push it using "Git push" menu under "Git" menu
- Clone your repository on your computer using "
git clone [<repository>]" - Create your .sql file in SSMS
- Save it under your local git repository folder
- Commit using "Commit" menu under "Git" menu (This command adds all the modified files and commit them)
- Push it using "Git push" menu under "Git" menu
- Clone your repository on your computer using "
git clone [<repository>]" - Delete the file(s) from your file system
- Commit using "Commit" menu under "Git" menu (This command adds all the modified files and commit them)
- Push the changes using "Git push" menu under "Git" menu
- Lesly Bernaola - email




