Latest entries
Exporting VARCHAR MAX and NVARCHAR MAX to CSV

Exporting VARCHAR MAX and NVARCHAR MAX to CSV

Recently, I had to export some query results to CSV and Excel. One of the columns was extremely large query text which was defined as NVARCHAR(MAX). Here are some of the issues I faced with this request and how I over came them. Initial setup and thought process The request was to pull query text...
When Excel will not convert a date to a date

When Excel will not convert a date to a date

While working with several CSV files, I found myself in a strange situation. I had merged the file contents into a single CSV file. I then opened the file in Excel, only to find that the Date column had data that was a mix of YYYY-MM-DD and MM/DD/YYYY. There are several things that can cause...
Useful SQL Server Date Formats

Useful SQL Server Date Formats

Here are a few date formats that I’ve found useful over the years. These all come from getdate() and are changed by using COVERT or FORMAT commands. I’ve chosen a few of the date formats I’ve used the most: YYYY-MM-dd YYYY-MM-dd HH:mm YYYYMMdd YYYYMMdd_HHmm You can take the results from the commands and assign them...
Finding the SSRS Log File

Finding the SSRS Log File

Discover how to find and examine the SQL Server Reporting Services log file.
T-SQL Tuesday March 2019 – Dipping into the Cookie Jar

T-SQL Tuesday March 2019 – Dipping into the Cookie Jar

This month's TSQL Tuesday is hosted by Shane O’Neill (B/T). The challenge this month is to write about "Dipping back into the cookie jar" or using the memories of a past challenge or accomplishment to help you through a new issue.
T-SQL Tuesday July 2018 - Working with Dates

T-SQL Tuesday July 2018 – Working with Dates

This snippet is so nice, I’m posting it again! I’ve utilized the script below at least once a week, for either reports, or working with large data sets. Rather than reinventing the wheel, I’m posting my code here and to GitHub for everyone to see. The script expects two date parameters, a start date and...
List all Active Directory Groups for users in an Active Directory group

List all Active Directory Groups for users in an Active Directory group

The following PowerShell script finds all of the Active Directory group memberships for users in a target Active Directory Group. All you need to provide is the target Active Directory group, and the script does the rest.
Generate fresh data for WideWorldImporters

Generate fresh data for WideWorldImporters

See how to use built in stored procedures to grow the WorldWideImporters SQL Server database with new, current data.
Loop over dates in SQL Server

Loop over dates in SQL Server

I’ve written the script below at least once a month, for either reports, or working with large data sets. Rather than reinventing the wheel, I’m posting my code here and to GitHub for everyone to see. The script expects two date parameters, a start date and an overall end date. The script will then assign...
Stored Procedure Results in an SSIS Message Box

Stored Procedure Results in an SSIS Message Box

I was recently asked if it is possible to display the results of a query / stored procedure in an SSIS Message box. The answer is Yes, with a bit of C#.
Recover the missing Report Data tab in SSRS

Recover the missing Report Data tab in SSRS

Learn how to recover the Report Data tab in SQL Server Reporting Services (SSRS)
SQL Saturday 550 - San Antonio - Sessions I'm Attending

SQL Saturday 550 – San Antonio – Sessions I’m Attending

I was lucky to be picked to present at SQL Saturday 550 in San Antonio this year! But, not only do I love presenting, I also love attending as many sessions as I can. Here are the sessions I am looking forward to: Log SQL Server Activity on a Budget – Rudy Rodarte – Level:...