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

Never is Not the Policy

Years ago I worked with a few developers and DBAs that were temp-table happy. As in they defaulted to using temp tables everywhere. This was in SQL Server 6.5, and tempdb was an issue with contention, sizing, and performance. I rewrote so many queries to remove temp tables for our clients that I banned them. I told other developers they could never use temp tables in their SQL code. They, of course, would try to submit code with temp tables in our VCS (Visual SourceSafe at the time), but an early, pre-automated CI/CD would notify me and I'd have the developer rewrite their code.

There were situations that didn't perform well with a single query, and we did allow some temp tables. The point wasn't the ban them entirely, but stop them from being a crutch for developers or a first choice. I wanted them to think about the problem first and try to solve it with SQL. If performance was an issue, then we'd look at a temp table.

Recently, I saw a post from Jeff Iannucci that noted there are settings you should never change. These were database-level or instance-level settings that he suggests you leave the defaults, or leave a specific setting chosen. An example of the latter is Page_verify set to checksum. The default in older databases, upgraded through different versions, can be none or torn page detection enabled. Fix that if you see it.

Examples of other settings are things like Auto Shrink and Auto Close, which shouldn't be enabled. These types of settings should be left off, well, with a caveat from me. There are narrow places where you might want certain things turned on. For example, Auto Close isn't the worst thing in the world, and there places where it makes sense. Dev servers with a large number of databases that aren't often used might get help here in conserving resources. Same for production instances where a lot of older databases are kept around for archival, but we don't want them open and consuming any resources without an explicit connection.

I don't mind DBAs or developers having "never" as a policy for certain things, with the caveat that this isn't a forever rule, but one that strongly sets a guideline that we don't create exceptions for without a very good reason. Staffs change, internal knowledge is lost or narrowly shared, and often inexperience can creep into your environment. These strongly worded guidelines, even with "never" in them, help to keep everyone on the same path.

Strong opinions, loosely held. We change our minds and grant exceptions when there is evidence to do so.

Steve Jones - SSC Editor

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

 
 
 Featured Contents
SQLServerCentral Article

Automating SSAS Multidimensional Security Audits with PowerShell

Pablo Echeverria from SQLServerCentral

This article presents a way to audit your SSAS cubes using PowerShell to prepare for any audit questions about who has access to the data.

Technical Article

Miscellaneous Thoughts About Building Stuff with AI in July 2026

Additional Articles from SQLServerCentral

Over the past couple of years, I've been using the bejeezus out of AI. I don't really feel like an expert by any means - it's so hard to keep up with the advancements - but I've been enjoying reading Grant Fritchey's series on building stuff with AI, and I thought you might enjoy some of my lessons learned as well.

Blog Post

From the SQL Server Central Blogs - SQL Server sa Account Security: Rename, Disable & Best Practices

SQLPals from Mission: SQL Homeostasis

SQL Server sa Account Security: Rename, Disable & Best Practices

In the Windows administration world, it's pretty much a standard practice to rename the local administrator...

Blog Post

From the SQL Server Central Blogs - Stanford Emerging Technology Review 2026 Report is out

K. Brian Kelley from Databases – Infrastructure – Security

Artificial Intelligence and quantum computing are two areas of emerging technology that receive most of the tech news. However, the Stanford Emerging Technology Review tries to include any relevant...

Technical Article

Databricks Data Intelligence Platform: Unlocking the GenAI Revolution

Site Owners from SQLServerCentral

This book is your comprehensive guide to building robust Generative AI solutions using the Databricks Data Intelligence Platform. Databricks is the fastest-growing data platform offering unified analytics and AI capabilities within a single governance framework, enabling organizations to streamline their data processing workflows, from ingestion to visualization. Additionally, Databricks provides features to train a high-quality large language model (LLM), whether you are looking for Retrieval-Augmented Generation (RAG) or fine-tuning.

 

 Question of the Day

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

 

Rebuilding All Indexes

I have added a few indexes to one of my tables in SQL Server 2025:
ALTER TABLE dbo.CustomerContact
ADD CONSTRAINT PK_CustomerContact
    PRIMARY KEY (CustomerID);

-- Create index on CustomerEmail
CREATE INDEX IX_CustomerContact_CustomerEmail
ON dbo.CustomerContact (CustomerEmail);
CREATE INDEX IX_CustomerContact_CustomerEmail
ON dbo.CustomerContact (phone);
I then do this to disable one index:
alter index IX_CustomerContact_CustomerPhone on dbo.CustomerContact disable
I see this when I check the index status: Index status for CustomerContact I decide to rebuild all indexes with this command:
ALTER INDEX ALL ON dbo.CustomerContact
After I do this, what will I see for the index status?

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

 

 

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

Database Mail Configuration

If I want to get a list of the configuration settings for Database Mail using T-SQL,  how can I do so?

Answer: Use the msdb.dbo.sysmail_help_configure_sp with no parameter name.

Explanation: The sysmail_help_configure_sp will return the various properties of Database Mail is no parameter is passed in. Ref: sysmail_help_configure_sp - https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sysmail-help-configure-sp-transact-sql?view=sql-server-ver17

Discuss this question and answer on the forums

 

 

 

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 - Administration
Removing production permissions when restoring database to non-prod - Hello experts, An application team has asked us to modify a SQL Agent job. The job currently restores a backup of the production database to their test SQL Server. We do have provisions for masking the non-prod data. However, for years I have used a script to preserve the test db permissions and then replace […]
Editorials
Are You Working More Hours? - Comments posted to this topic are about the item Are You Working More Hours?
Finding Bad Queries - Comments posted to this topic are about the item Finding Bad Queries
VACATION! - Comments posted to this topic are about the item VACATION!
Fixing P1 Queries - Comments posted to this topic are about the item Fixing P1 Queries
SQLServerCentral.com Test Forum
Test topic for spam filtering - A new thread for testing the spam filter. Adding a link: https://www.bbc.co.uk/weather
Article Discussions by Author
Stairway to Reliable Database Deployments Level 6 – Managing Changesets Over Time - Comments posted to this topic are about the item Stairway to Reliable Database Deployments Level 6 – Managing Changesets Over Time
A Limited Startup - Comments posted to this topic are about the item A Limited Startup
T-SQL in SQL Server 2025: REGEXP_LIKE - Comments posted to this topic are about the item T-SQL in SQL Server 2025: REGEXP_LIKE
Advanced T-SQL: Replacing Slow Cursors with Window Functions - Comments posted to this topic are about the item Advanced T-SQL: Replacing Slow Cursors with Window Functions
The Service Name - Comments posted to this topic are about the item The Service Name
Why SQL Server Database Attach fails and how to repair it - Comments posted to this topic are about the item Why SQL Server Database Attach fails and how to repair it
BIT_COUNT() IV - Comments posted to this topic are about the item BIT_COUNT() IV
Symmetric Key Encryption - Comments posted to this topic are about the item Symmetric Key Encryption
SQL Server 2022 - Development
iso source of scripts. - While doing some housekeeping I came across a folder containing some scripts that appear to be for a transaction log alert system. Now all scripts except one obviously were generated by SSMS which indicates I didn't save the original scripts or I did this project from a video and wanted to save everything before I […]
 

 

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

 

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