未加星标

T-SQL Tuesday #83 Dealing With the Same Problems

字体大小 | |
[数据库(mssql) 所属分类 数据库(mssql) | 发布者 店小二04 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

T-SQL Tuesday #83   Dealing With the Same Problems
T-SQL Tuesday #83 In the <N> years I have been a database professional, we’re still dealing with <some problem> In the <N> years I have been using SQL Server, we’re still dealing with <some problem>

This month’s T-SQL Tuesday topic is hosted by my friend and former colleague Andy Mallon ( blog | twitter ). I’ve completed one of his fill-in-the-blank prompts to read like so: In the four years I have been a database professional, we’re still dealing with lack of documentation .

When I use the term documentation I’m being intentionally vague because the problem is systemic and doesn’t only apply to database-land. We see the problem in the business requirements (if we’re lucky enough to have any written specs at all). We see the problem in the architecture. We see the problem in the code.

Why Documentation is Important You, being the only person who wrote, reviewed, and deployed your code, may tomorrow be hit by a bus, leaving the rest of your team stricken with grief and utterly confused as to what your code actually does (this bus-factor of one should be avoided at all costs). You wrote the code so long ago that even you don’t remember what it does anymore, and have to spend extra hours working backwards to reverse engineer it. Your team may be expanding and growing, and as new people join they will need to be brought up to speed on your processes and procedures. Having sufficient documentation in place can expedite this process. When something inevitably blows up in production, you can sift through a well-documented change log / code repositoryto decipher whether a recent change caused the issue. When the business knocks down your door to ask why it’s taking so long to implement all the shiny new features, you can refer them to the requirements documents / backlog to help prioritize tasks and maintain order amidst the chaos. A Little Documentation Goes a Long Way Business Requirements

Get the business to commit to something in writing. Help guide and translate. Use a system like TFS or JIRA to create and manage a backlog, prioritizing requests as they come in or on a periodic basis. All of these suggestions help to set expectations, avoid scope creep, and keep everyone on track.

System Architecture

An up-to-date inventory of SQL Servers is a must for any DBA (bonus points for automating the inventory process). Additionally, it’s important to have high-level visual diagrams (a la Visio or PowerPoint) of all the major systemsand their integration points into the application(s). This is especially important for SSIS packages, which can be a bear to troubleshoot when starting from scratch.

Code

Every stored procedure should have a comment header at the top. This is programming 101. Essential elements of a header include a brief description of what the procedure does, what the parameters are used for, the author’s nameanddate of creation. Additionally, it’s important to sprinkle comments (one liners or blocks) throughout, highlighting the reasons for using eccentric techniques or explaining a particularly complex bit of code. Changes should also be documented either in the header or in yoursourcecontrol system.

Start Documenting Now

I know what you’re thinking, and I hear (and may have even used myself) the excuse all the time: I don’t have time to document my code. The servers are on fire, management was promised product xyz would ship six months ago, and I’m too busy defragging all the things to stop and document every line of code in the system! It’s OK. Even just a few lines of documentation can go a long way in helping to avoid confusion for others, and yourself, in the future. It’s also a huge return on investment when you think of the hours you’ll inevitably save yourself down the road.

本文数据库(mssql)相关术语:熊片数据库 mssql数据库 oracle数据库 pubmed数据库 access数据库 万方数据库

主题: SQLSQL Server
分页:12
转载请注明
本文标题:T-SQL Tuesday #83 Dealing With the Same Problems
本站链接:http://www.codesec.net/view/482270.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mssql) | 评论(0) | 阅读(35)