Link to home
Avatar of happy 1001
happy 1001

asked on

How to systematically manage a Big List of Queries and Tables in SQL Server ?

Suppose someone has to work on a lot of different SQL Server Databases which have got a lot of Tables and Queries / Views inside them.

After a period of time, it becomes very difficult to remember exactly what kind of columns are present within a given Table and View.

Please suggest some method by which one can keep a systematic list of all the Tables and Views that are present within a SQL Server Database, along with the columns that are present within them.
Are there any Add-on products or services etc. available that helps in making this type of work systematic?

Currently I add comments to each queries inside SQL Server to remind me of what this query is doing, but this method is not great. I am looking for some better and more efficient methods.

Please share any ideas that you might have in this direction.

Thanks a lot
SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
After a period of time, it becomes very difficult to remember exactly what kind of columns are present within a given Table and View.
Unless you are working only with a single database and the database has very few tables and views then no one can remember everything in a database.

Please suggest some method by which one can keep a systematic list of all the Tables and Views that are present within a SQL Server Database, along with the columns that are present within them.
There are products that keeps all information about a database model. You can also use the Diagrams option in MSSQL Management Studio.

Currently I add comments to each queries inside SQL Server to remind me of what this query is doing,
How do you keep queries inside SQL Server? Are you talking about Views and Stored Procedures? Anyway, comments are always welcome since you don't know if in a few years you'll need to make a change in the query and having all objects commented it will help you to understand the table/view/query/etc... in the future.
Avatar of happy 1001
happy 1001

ASKER

Thanks Jim
I will check out Doc xPress tool.
---------------------------------

Thanks for your reply Victor.
There are products that keeps all information about a database model. You can also use the Diagrams option in MSSQL Management Studio.

Please name a few of such products. I am looking for them.

How do you keep queries inside SQL Server? Are you talking about Views and Stored Procedures?

Mostly I keep the queries in the form of SQL codes within a .sql file, where I add comments under each such query, giving some details. But this method is not at all efficient, as the SQL file grows very long and it becomes hard to manage, therefor I was looking for some better alternatives.

Thanks
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Thanks Victor, that was quite helpful. I was not aware of this option earlier.