SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

Featured Script

The Voice of the DBA

Monitoring for Non Existent Events

This editorial was originally published on July 31, 2014. It is being re-published as Steve is out of the office.

I was catching up on work recently, reading the third installment of The 5 Worst Days in a DBA's life, starring The DBA Team. Someone had asked me if I enjoyed having Paul Randal (b | t) of SQLskills join them team. The piece had been edited and published while I was gone, and I hadn't had a chance to immerse myself in the adventure. I was anxious too read how Paul helped save the day. 

It was a fun read, but one quote in the piece struck me. "A job that runs long or doesn't run at all can sting just as bad as one that fails." That's a quote from my character showcasing a situation that few people actually think about. However jobs that don't run or don't finish are situations that DBAs should be monitoring for.

So many of us adopt a set-it-and-forget-it mentality with our jobs. We assume that things will work, or fail, as we set them up. However it's easy to forget that there are other states we might find ourselves or our systems in that can cause issues.

Monitoring is critical to any well run system, but monitoring needs to be set up well. If we require that certain jobs run, we need to not only check for success or failure, but if the job has actually run and completed. It's easy to accidentally disable the wrong job and not notice. It's also entirely possible that a job gets stuck and doesn't complete.

If you're not watching for those other states, you might find yourself in a situation where you don't have backups and your job is on the line. However you probably won't have The DBA Team to call on.

Steve Jones from SQLServerCentral.com

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

SQL Compare

The industry standard for comparing and deploying SQL Server database schemas

Trusted by 71% of Fortune 100 companies, SQL Compare is the fastest way to compare changes, and create and deploy error-free scripts in minutes. Plus you can easily find and fix errors caused by database differences. Download your free trial

Database DevOps

Benchmark your Database DevOps maturity level

Get a better understanding of how advanced your current processes are, receive recommendations for improvements, and see how your maturity level compares with that of your peers. Complete the Database DevOps Maturity Assessment

Featured Contents


Stairway to Columnstore Indexes Level 3: Building The Columnstore

Hugo Kornelis from SQLServerCentral.com

The performance increase columnstore indexes grant when reading data from the index is offset by the expensive process required to build the index. In this Stairway level, Hugo Kornelis walks you through the steps SQL Server takes when building (or rebuilding) a columnstore index. More »


Free eBook: Troubleshooting SQL Server: A Guide for the Accidental DBA

Press Release from Redgate

Three SQL Server MVPs (Jonathan Kehayias, Ted Krueger and Gail Shaw) provide fascinating insight into the most common SQL Server problems, why they occur, and how they can be diagnosed using tools such as Performance Monitor, Dynamic Management Views and server-side tracing. The focus is on practical solutions for removing root causes of these problems, rather than "papering over the cracks". More »


How to Enable Transparent Data Encryption

Additional Articles from Database Journal

By default, SQL Server does not encrypt data in a SQL Server database in an encrypted format. When SQL Server 2008 was introduced, Microsoft implemented Transparent Data Encryption (TDE). When TDE is enabled on a database SQL Server will encrypt the database as data is written to the disk. More »


How to build a DevOps roadmap to kickstart your digital transformation journey

By harnessing the concept of agility to a methodology that enables constant software innovation, DevOps allows organizations to respond dynamically to changing market conditions and rising customer expectations. More »


From the SQLServerCentral Blogs - Safely and Easily Use High-Level Permissions Without Granting Them to Anyone: Server-level

Solomon Rutzky from SQLServerCentral Blogs

Part of having good security is giving users the fewest / least permissions possible in order to execute the code. However,... More »


From the SQLServerCentral Blogs - A Guide for Decrypting SQL Server Database Objects

Lincoln Burrows from SQLServerCentral Blogs

Overview The SQL Server 2005 and SQL Server 2008 provide a new feature for encrypting data to protect it from... More »

Question of the Day

Today's Question (by Steve Jones):

I want to use the  mathematical function cosine function in a Python script inside of SQL Server. I know that this function isn't in the base Python interpreter, but is in the math module. What do I run to get access to this function in my script?

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

We keep track of your score to give you bragging rights against your peers.
This question is worth 1 point in this category: Python.

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.


Design and configure SQL Server instances and databases in support of high-throughput applications that are mission-critical and provide consistent response times in the face of variations in user numbers and query volumes. Learn to configure SQL Server and design your databases to support a given instance and workload.

Pick up your copy of this great book today at Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I run this code on SQL Server 2016:


I then want to get that data later in my application. I run this:


I don't get 55 back. Why not?

Answer: The data in CONTEXT_INFO() is binary, so I need to cast this back to numeric.


Context_info take binary data in and returns binary data. The result needs to be converted back to integer (or numeric) data.

Ref: CONTEXT_INFO() - click here

» Discuss this question and answer on the forums

Featured Script

SQL Server Missing Index

Yusuf Kahveci from SQLServerCentral.com

We will use this script to find missing indexes in our database.





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 2016 : SQL Server 2016 - Administration

Need Tutorial on Differential Backup - I need to backup a SQL Server 2016 database weekly - and take incremental backups daily I found this snippet: -- Create a...

San block sizes - I appreciate this isn't a SAN forum.  I'm exploring recommended block sizes to have for an all SSD SAN for...

SQL Server 2016 : SQL Server 2016 - Development and T-SQL

DTSX Pkg From Stored Procedure (completely frustrated) - Help please!!  I am bruised and bloodied from mashing my head, for two weeks now, against stuff I do not...

Tracking changes on Views. - Tracking changes in/on Views. Are there any good scripts/documents/advises/tips on Tracking changes on Views? I asume that I am not the first...

Delete 5 lac records from table - I have a table where there is a column called nationality having possible values "US" and "Non -US'. I need to...

SQL Server 2014 : Administration - SQL Server 2014

What are SHOWPLAN security risks? Should a query optimizer person (not DBA) have access to it? - Strange situation. Myself and one other person (the DBA/ sysadmin) --- manage a Data Warehouse for a company BI. I'm a subject matter...

Application starts throwing SQL error after database failover. - I have a situation and looking for some guidance. I have a two node SQL server always on on setup...

SQL Server 2014 : Development - SQL Server 2014

Add Group ID value for set of sequential rows - Hi To be honest I wasn't sure how to phrase this subject, I hope it makes sense after I describes my...

SSRS Report: Any way to copy or download either an RDS file or the text needed to create one? - It's been a while since I dealt with SSRS.   Am hoping to find an easy way to either download a...

OpenRowSet No Field Terminators - Hi, To start I have minimal experience with OpenRowSet and BCP. I usually do processing with SSIS but this new project...

upsert in ssis for large tables - I have 40 tables having different structure in one of DB on one server that is being updated by data...

SQL uses 2 different executions plan (slow and fast) for a simple query. Need a new index ? - Hi everyone, I am experiencing a performance issue with one process in our system. The performance issue is intermittent, the users...

Question about a composite key and autoincrement - Hello all, I was recently assigned to convert an Access database to Sql Server.  I have to try and keep the...

Looking to sort two queries by Date, Time - SELECT LTRIM(RIGHT(CONVERT(varchar(6), .,100),7)) AS --, FORMAT(., 'MM-dd-yyyy')       AS , CONVERT(varchar(10),REPLACE(CONVERT(varchar(10), .,101),'/','-')) AS , LTRIM(RIGHT(CONVERT(varchar(20),

SQL Server 2012 : SQL 2012 - General

Covering Index vs Include Index - I’m looking intocreating indexes and I want to know which types of indexes are better and inwhich situations to use...

SQL Server (MSSQLSERVER) keeps Stopping - Hello, Trying to connect to sql server database engine, via ssms, but won't connect. I get the standard error: A network-related or...

SQL Server 2012 : SQL Server 2012 - T-SQL

Query to increment an alpha character suffix - Need some help from the TSQL gurus. The situation is that given data in the column a table, data in...

How to handle very large dataset - I need to find the most recent post date for all the invoices in my table. There are millions of...

Enter maximum value on the basis of 2 independent tables. - Hi Folks,  I stuck in a puzzle, please suggest a way to resolve this.  I have 2 below Tables in my database. Tab_A...

Programming : SSDT

Importing Loads of Fixedwidth flatfiles - hi i've got a big bundle of fixedwidth flatfiles to import. i have the supplier documentation to show me where the columns...

This email has been sent to {user_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.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com