Answer the question
In order to leave comments, you need to log in
How to properly store T-SQL code snippets?
Hello dear!
I am a software support specialist that works with Microsoft SQL Server databases.
At the moment I have a large dump of files with solutions for various kinds of errors. Software products are quite capacious (from 20 to 100 sections with a large number of tabs), but, unfortunately, I do not know how to properly structure queries for convenient and quick access to them and further use in my work.
Tried several options:
Storage using projects in SQL Management Studio:
<Project 1>
--filename1.sql
---filename2.sql
-- ...
-- filename50.sql
<Project 2>
<Project ...>
<Project 10>
Answer the question
In order to leave comments, you need to log in
A good enough way is to install Visual Studio Data Tools, create a separate DataBase project for each database, automatically generate each database's SQL DDL in the project, and add your files to the Scripts folder of the corresponding project. Everything will be stored in one place and have a convenient toolkit for editing SQL code. And finally, the entire solution should be saved in the version control system (SVN, Git, Mercurial, etc.).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question