Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
Featured Script
The Voice of the DBA
 

Building Helpful Commit Messages

Using a VCS (Version Control System) is important in any modern software development environment. I still can't believe that both application and database developers are using a VCS at less than the 95% level, but surveys constantly show this. I'm not sure if this is because of laziness, ignorance, stubbornness, or something else, but it's a bad idea. Start using a VCS. Talk to your management, and let them know Git is free and can be run on premises, much like a file share for code, except it's better.  Even if you hand craft scripts (or use the SSMS GUI), just start saving those scripts in a VCS.

There are lots of tutorials and examples of how to use git (or any VCS), and this is a skill you want to build over time. To start, just learn to build a habit of committing code to the repo as you make changes. This is fairly easy, but there is one skill you need to develop over time: how to write a good commit message.

When we commit code, we usually need to enter some comment. This is a bit of an art, and should be designed to quickly convey information to the next developer (who may be your own future self). While people may have their own view on what to include, my thought if usually to include the "why" of the commit. This helps me to go back later and understand what I was thinking. I don't need "what" was changed, because a quick diff of the file will explain that. If possible, I like to relate a commit to a specific request, like a Work Item, a help ticket, or some place that describes the requirements in more detail.

I ran across a nice post that describes the art of the commit, and I think there are some good ideas here. Certainly being brief and understanding that often your message is a headline is good advice. The most important parts of the post, for me, are the need to understand that I'm working with others, and it's important that my message help them and vice versa.

Learning to use a VCS is a critical skill for anyone working in the technology field. We know most application developers need this, and slowly I find more database developers doing the same. However, as we move to GitOps and Configuration and Code, as compliance becomes more impactful with more auditing requirements, as we try to do more with less, the infrastructure staff and others need to learn how to capture their changes in a VCS as well.

Do yourself a favor and start learning how to use a VCS. Git makes it easy or you can play with Azure DevOps in the cloud. Just start saving some files and building skills. Your career will thank you. Learn to write good commit messages and your team will appreciate you.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
Redgate SQL Provision
 Featured Contents

COLUMNS_UPDATED() and Triggers

habib from SQLServerCentral

This article will examine how the COLUMNS_UPDATED(...

A MongoDB to SQL Server Migration: Data Typing and Un-nesting

Additional Articles from SimpleTalk

Importing data from one system to another is a common task for database professionals. It’s possible to spend a lot of time figuring out what the schema should be for the target table. In this article, Rodney Landrum demonstrates an interesting solution to automatically figure out the data types and un-nest delimited data.

Download your free copy of the 2019 State of SQL Server Monitoring Report

Additional Articles from Redgate

Over 800 SQL Server Professionals took part in the State of SQL Server Monitoring survey. Providing insights into how they monitor their SQL Server estates, the technologies they work with, what their biggest challenges are, and what the future trends for the industry are likely to be. For the detailed analysis of the responses, download your free copy of the report.

From the SQL Server Central Blogs - Workload replay with WorkloadTools

spaghettidba from SpaghettiDBA

In my last post, I described how to capture a workload to a file, in order to run a replay against your target environment at a later time. Well,...

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

The special columns

If I run sp_special_columns on a table, what is returned?

Think you know the answer? Click here, and find out if you are right.

 

Redgate SQL Source Control
 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Cleaning Overhead

Why is it not recommended to run sp_clean_db_file_free_space() during normal production hours?

Answer: Because of the IO load

Explanation: This procedure will clean ghost records from pages, but this can significantly affect IO activity. As a result, this is not recommended to run during normal production hours. It should be run outside these timeframes. Ref: sp_clean_db_file_free_Space() - https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-clean-db-file-free-space-transact-sql?view=sql-server-2017

Discuss this question and answer on the forums

 

Featured Script

Find Estimate Time of recovery for database after Reboot

hkamal.infoedge from SQLServerCentral

This Script will  read the Estimated Time for recovery from Error Log

DECLARE @DBName VARCHAR(64) = 'DatabaseName'DECLARE @ErrorLog AS TABLE([LogDate] CHAR(24), [ProcessInfo] VARCHAR(64), [TEXT] VARCHAR(MAX))INSERT INTO @ErrorLogEXEC master..sp_readerrorlog 0, 1, 'Recovery of database', @DBNameSELECT TOP 5[LogDate],SUBSTRING([TEXT], CHARINDEX(') is ', [TEXT]) + 4,CHARINDEX(' complete (', [TEXT]) - CHARINDEX(') is ', [TEXT]) - 4) AS PercentComplete,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0 AS MinutesRemaining,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0/60.0 AS HoursRemaining,[TEXT]FROM @ErrorLog ORDER BY [LogDate] DESC

More »

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2017 - Administration
How do I GRANT permissions on these? - "Accidental" DBA here and we are trying to improve our security.  We have created a new user that has far more limited security for a particular purpose than the one previously used, but I need to GRANT the following to the new user: User needs to SELECT on sys.procedures and be able to execute OBJECT_DEFINITION() […]
DW - Data Extraction RI issue - We are taking approach for Extracting data from source to target but have your advice. Our approach is: 1) Drop the RI Constraints 2) Truncate the Tables 3) ReCreate the  RI Constraints 4) Extract data from source to target Now confusion is during this process before or during recreating RI constraints if we loose DB connection or […]
SQL Server 2016 - Administration
Key Lookups - I'm trying to come up with a script that will identify key lookups that have a certain percentage of the query cost. Like if the key lookup is 50% of the query cost then I want the result set.
SQL Server 2016 - Development and T-SQL
Procedure to find record in same table in multiple databases - I need to be able to return a recordset of server name and database name for all databases that have the 'humres' table which contains a record in the table with a column 'usr_id' with value of a passed in username param. i.e. create proc getDBs(username varchar(8)) AS ( ..... )
index usage help - Hi All, Will any index will be used if we use functions on a column referred in the where, what is the best way to re-write this condition? SELECT..... WHERE to_char(lastUpdatedDate,'YYYY-MM-DD')>=@dt Please suggest. Thanks, Sam
System.Net.WebException: 'The request failed with HTTP status 403: Forbidden.' - Post was not responded to here, so I moved it here:  https://www.sqlservercentral.com/forums/topic/system-net-webexception-the-request-failed-with-http-status-403-forbidden-2
Administration - SQL Server 2014
Question related to AG's - Hi All, We are using SQL Server 2014 Enterprise Edition. We have 2 node Availability groups for high Availability purpose. One node as primary and one for secondary. Now the plan is to have a DR setup which is a standalone sql instance which is remotely located. Can we setup log shipping between an AG […]
The MSSQL Standard edition, does it limit the number of Work Threads? - I have a server with 128 logical processors, 64 bits server, and with a Standard edition of SQL Server 2014, and my question is this: Considering that SQL Server connects an ERP with a high number of simultaneous connections (approximately 1,000), and the characteristic "Maximum calculation capacity" for each of the editions of SQL Server, […]
Development - SQL Server 2014
simple query question, using ROLLUP instead of COMPUTE - A database was upgraded from 2008 to 2014 sqlserver, a report that was running using  COMPUTE to summarize totals quit working, as this function was deprecated with SS 2012. I wrote this query some years ago, adapted from an Oracle database I was pulling similar information from. The original query gave nice totals by SystemUser, […]
SQL Server 2012 - T-SQL
Indexing question - Hi All, What is the main difference between normal index rebuild and online index rebuilds? is there any performance benefits ? does it avoid blocking on large tables ? What actually happens behind in offline index rebuild and online index rebuild. Trying to see if anyone can explain in layman terms. Its quite overwhelming if […]
SQL Azure - Development
Azure Data Migration - Hi New to Azure and looking for the best options/approach to transfer on premise data to Azure BLOB (initial load about 1 - 5 TB) and also incremental changes thereafter.  Can you please provide the best options available?   Thanks  
SSRS 2016
System.Net.WebException: 'The request failed with HTTP status 403: Forbidden.' - When my application code goes to set the parameters for a reportviewer control for an SSRS report, I get the System.Net.WebException: 'The request failed with HTTP status 403: Forbidden.' error Not sure why.   I've set the credentials to the default network credentials, and I know have rights to see that report.   Wondering why I can't […]
Integration Services
Executing Flat file query - Hi , I have table/procedure/function script in flat file, i'm looking for solution to execute scripts (flat file) in SQL server db using SSIS. I have tried to use foreach loop - flat tile connection and execute SQL task - seems incorrect. Any help much appreciated, Thank you!
SSIS version - I recently opened a SSIS soltion that is developed by another developer. And I modified a package in it, then saved in subversion. But I open again, we cannot open the script component. And later we found out that in the source file of the ssis package, my version is different version than the other […]
SQLServerCentral.com Announcements
Status Update 2 Jul 2019 - Things have slowed down, so not a lot of progress to report, but a few new items logged, so worth tracking here again. Fixes Admin payment report time zones match browsers contribution center performance issue and wording changes Search is getting close to a beta launch, but still waiting on some Google crawls. They haven't […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -