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

The Importance of Consistent Server Setup

Today we have a guest editorial as Steve is traveling.

I am going to guess I am preaching to the choir on this one. Very few DBAs tolerate inconsistent setups on their managed database servers. I suppose if you are a small shop and there are only a few servers, the server setup doesn’t matter as much. When you are in a larger shop, consistency becomes very important.  I have worked places where the test servers had completely different setups from the production servers and that made life difficult for me.

Some things, like consistent drive letter setup, can be really nice to have. When all the data, log, temp db files are on a consistent drive and folder, it is easier to manage and know where things should go. Sure, you can and should setup the default locations in the SQL Server settings, but having the database files in the same location is one less thing to remember. Similarly, with backup locations, who wants to have to remember different backup share locations based on the server / site you are on?

I also prefer to have the database names be consistent across dev, test, stage and production. When dev and test servers add _dev or _test to the end of the production database name, I go nuts. Since a server is already a dev or test box, I would rather keep the database name the same as production. I have run into some issues when stored procs access multiple databases. They break when the dev or test environments are refreshed from production. In this scenario the stored procs have to be updated to point to the new database name with the _dev or _test appended to it.

Now perhaps the issue for some of us is that dedicated dev and test servers don’t exist. Perhaps you have one server that serves as both a dev and test box. I believe since virtualization has come so far and is relatively easy to use and setup, this shouldn’t be stopping too many people anymore. In other cases, I am sure there are just old servers and old setups that have been inherited. Still, the time spent cleaning things up to make them consistent once and for all will be worth while in the end.

Scripts are easier to manage when database server setups are consistent. Nothing complicates a PowerShell script better then having to accommodate different sites drive configurations. Or worse yet, to have different scripts because the setups are too diverse to have a single script for all sites. Then of course you run the risk of accidentally copying the wrong script to a site. Also, there is the extra burden of having to update multiple versions of a script when some change is needed.

So how about you? Is your current environment consistent? Does it bother you when it isn’t? Share an inconsistency server setup nightmare you have experienced.

Ben Kubicek from SQLServerCentral.com

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

ADVERTISEMENT
SQL Monitor

What’s the top challenge faced by SQL Server professionals in 2018?

Learn how 626 SQL Server professionals monitor their estates in our new report on the State of SQL Server Monitoring. Discover the challenges currently facing the industry, and what is coming next.  Download your free copy of the report

SQL Prompt

Write, format, analyze, and refactor SQL fast with SQL Prompt

Writing SQL is 50% faster with SQL Prompt. Your SQL code can be formatted just the way you like it, you can create and share snippets with your team, and with code analysis you get suggestions to improve your SQL as you type. Download your free trial

Featured Contents

 

Trigger Happy

Andy Jones from SQLServerCentral.com

This article looks at using triggers to audit and to prevent the performing of unintended actions. More »


 

Finding & Fixing Statistics Without Histograms

Additional Articles from Brent Ozar Unlimited Blog

Men Without Hats were awesome. Statistics without histograms are terrible, but now they're easy to find and fix. More »


 

Redgate University has opened its doors online

Redgate has established the Redgate University, an online resource where you’ll find self-paced training courses with easy to follow classes to help you and your team learn the fundamentals and best practices, and get top tips from the experts. More »


 

From the SQLServerCentral Blogs - Azure Cosmos DB Free Trial – walk through of Gremlin API for Graph

Arjun Sivadasan from SQLServerCentral Blogs

After the 2018 Microsoft Ignite event, Microsoft announced a free trial of Azure Cosmos DB. For those who are eager... More »


 

From the SQLServerCentral Blogs - The Developer’s Guide to Azure–A Good Overview

Steve Jones from SQLServerCentral Blogs

Someone sent me a link a few weeks back  about a free book from Microsoft. It’s the Developer’s Guide to... More »

Question of the Day

Today's Question (by Thomas Franz):

What would the following query return?

 SELECT TRY_CAST(CAST(-1234 AS BINARY(4)) AS BIGINT)

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: CAST.

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

ADVERTISEMENT

The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win

The company's new IT initiative, code named Phoenix Project, is critical to the future of Parts Unlimited, but the project is massively over budget and very late. The CEO wants Bill to report directly to him and fix the mess in ninety days or else Bill's entire department will be outsourced.  Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Evgeny Garaev):

What is the new property for the COLUMNPROPERTY() function that appeared in SQL Server 2016?

Answer: GeneratedAlwaysType

Explanation:

GeneratedAlwaysType is a new column value that is system-generated. This property is related to the new feature - temporal tables.

SQL Server 2016 introduced support for system-versioned temporal tables as a database feature that brings built-in support for providing information about data stored in the table at any point in time rather than only the data that is correct at the current moment in time.

Applies to: SQL Server 2016 (13.x) and later

Ref: ColumnProperty() - https://docs.microsoft.com/en-us/sql/t-sql/functions/columnproperty-transact-sql?view=sql-server-2017


» Discuss this question and answer on the forums

Featured Script

View Server Roles and Permissions per Login

Perry Whittle from SQLServerCentral.com

run against the instance for a view of server roles and permissions by login

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

How can reduce database log file size - Hi, Is it possible to reduce database log file (.ldb file) ? Can you advise any method to reduce log file size. Regards Binu

TempDB keeps growing for no reason. - Hi All, Thank you for looking into my question. I have SQL Server 2017 Enterprise server FailOver cluster (No Shared storage though)...


SQL Server 2017 : SQL Server 2017 - Development

dbMail parsing url ampersand to word "and" - I'm using dbmail to gather data and send an email.  As a part of that email, I have a url...

How do you handle SSIS package merging between two BI teams? - Hi!! Here's the thing - I have the following scenario: Base points - Multiple teams work on the same Data Warehouse (DW) - The SSIS...


SQL Server 2016 : SQL Server 2016 - Administration

Database in recovery mode not comming online - I checked database is IN Recovery. Error log Long Sync IO: Scheduler 11 had 1 Sync IOs in nonpreemptive mode longer than...

Connectivity issue with a multisubnet AlwaysOn - Hello, I have a problem with a multisubnet that I can't figure out how to resolve. I have a 2 replicas AlwaysOn...


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

Need to select rows with the latest date only - In the attached  image, i need to change the query to return only the rows with latest RecruitmentDate (highlighted in...

What are some really dumb things you could write in a SQL Query - We all know there are plenty of recommendations as far as what to avoid when writing T-SQL. For example, it's...

Given table names generate a Select template these tables. - At the moment I have some time on my hands. So I want to extend a Generation procedure with some 'extra'...

Understanding the numeric and decimal data types - I am testing various values to better understand the numeric and decimal data types.  First I believe they are the...

Importing from XML to SQL 2014 - This is my 4th day on SQL so I am a newbie. I created a query to import from an...


SQL Server 2014 : Development - SQL Server 2014

How to PIVOT various VAT breakdown options with Invoice Summary data - Countries like Canada have certain consumption taxes to be applied, when selling products, e.g. GST, HST, QST -  (if one is...

Showing all records that appear more than once - Hi everyone I'm trying to write some SQL that will allow me to pull all records where the NUMBER column appears...

looping through all databases to find dependencies (cursor) - I want to have a go-to query that finds all dependencies of an object, across all databases (without requiring any permanent object like a...


SQL Server 2012 : SQL 2012 - General

DB's with logfiles larger than datafiles - Hi all, Are there any scripts to identify databases whose logfiles larger than their associated datafiles?  I've of course had a...


SQL Server 2008 : SQL Server 2008 - General

Question regarding Multiple DB Users to a single SQL Login - Currently we have 1 DB User mapped to a unique SQL Login.  The way the software vendor (that makes the...

SQL Server 2008R2 - SQ Login Security Risks outside of SQL Server - Within a SQL Server 2008R2 setup what can the SA login do/access outside of SQL Server?  Specifically are there any...


Cloud Computing : General Cloud Computing Questions

Getting Drive Distance in Terms of Miles - I am curious to learn the best way to determine Distance for an application/Database I am developing.  Is there a...


Reporting Services : Reporting Services

How to create SSRS reports where my data source is SSAS cubes and these reports will have the filtered data based on the user who has logged in? - I want to create SSRS reports where my data source is SSAS cubes and these reports will have the filtered...


Data Warehousing : Integration Services

SSIS to load complex Excel files - Hi, I want to load the below table into SQL Server Database using SSIS package. Can you one please tell me...

This email has been sent to newsletter@newslettercollector.com. 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