Archive | SSDT (SQL Server Data Tools)

Who Has The DAC?: Or How I Found Out I Had The Dedicated Admin Connection On SQL Server

Here’s a quick little snippet of T-SQL script that will hopefully prove handy to someone (and that I’ll end up googling at some point and find my own blog post). Are you trying to determine who is currently using the dedicated admin connection (aka DAC) on a particular SQL Server? Did SSMS give you a […]

Error when trying to use DAC connection in SQL Server

So, one of my local databases got stuck in single-user mode. Easy solution? Connect to my instance using SQL Server’s Dedicated Admin Connection (aka DAC) and flip the database back to multi-user. Easy! Wait. What? TITLE: Connect to Database Engine —————————— Cannot connect to ADMIN:localhost\SQL2012. —————————— ADDITIONAL INFORMATION: A network-related or instance-specific error occurred while […]

SSDT Default Values For Smart Defaults

There’s a handy feature in SSDT (SQL Server Development Tools) that will automatically insert a default value into a column when you change it from nullable to NOT NULL. I wasn’t able to track down documentation specifying what the default values for the “smart defaults” were so I hopped into the SQL DB Pros corporate […]

Add Page Compression To Every Table In Your SQL Database The Winston Wolf Way

So you need to add page level compression to every table in your SQL Server database? I’m not going to judge you. I’m not going to tell you it’s a good idea or a bad idea. I needed to do it in my DEV environment and maybe you need to do it in your production […]

SQL Query To Find Expired Accounts In Active Directory: Knowledge Is Power And The Goodbye List

Alrighty. We’re all data people here so you know we all agree that knowledge is power. One thing that is absolutely helpful in a large corporate environment is knowing if someone has been let go/laid off/fired. Using linked server to query active directory you can fairly easily (especially if someone else wrote the query) see […]

Get The MAX Date From A Cube Using MDX

Here’s the goal: populate a sql variable with the max date from one of the dimensions in a cube. It takes a little bit of unusual code but it’s relatively simple so pay attention! It’s probably important to note this code is assuming you are using a smart key for your date dimension (e.g. the […]

SQL Job Steps And Run_Duration: The query that formats run_duration correctly and doesn’t make you want to shoot your eye out

Ever tried to figure out how long a step for a particular SQL Server job takes? You can of course get it from the Management Studio, but we’re database people! We want to see the trend over time not just a point in time! We want to write queries! Hooray for data! You do a […]

DAX Formulas To Know And Love

PowerPivot this. PowerPivot that. Blah, blah, blah. Sorry folks, I don’t have time to learn your new Excel plugin because I’m writing SQL! I’m hardcore! Well, I finally started using PowerPivot a few days ago and I’m pretty impressed (although I seem to be able to make Excel crash pretty frequently). So I’m starting a […]

We Don’t Need No Duplication: Eliminating the Visual Studio “Do Not Ignore Duplicate Key errors” warning.

So when I open up a SQL Server Analysis Services Project in Visual Studio and it gives me the warning “Do not ignore duplicate key errors. Change the KeyDuplicate property of the error configuration so that it is not set to IgnoreError.” I thought to myself: “That’s a good idea.” I ought to do that. […]

Resolving Analysis Services “The provider ‘SQLNCLI.1’ is not registered”

I know. While everyone else is moving on to SQL 2012 here I am upgrading a SSAS 2005 cube to SQL Server 2008 R2 Analysis Services. I can hear Garth imploring me to “Live in the now man!” So as I went about the mundane task of upgrading a cube from a really old version […]