Posts for: #SQL Server

Find columns with special characters

Problem

im special

Imagine a database where you want to know how many times a certain column contains a special character. The reason I had to do this was that I needed to know the impact of an export interface that wasn’t working properly with special characters.

But as lazy as I am when it comes to doing repetitive tasks, I had to find a way could easily get all columns with special characters in a data set without a lot of hassle.

Read more →

Get ASCII characters from string

I had a situation where I got an error converting a value to a decimal which had some white text and a valid number.

During the conversion, I used the LTRIM and RTRIM functions to remove any white spaces which were present at the beginning and the end of the value.

Unfortunately, the characters in the string didn’t get removed with these functions.

This led me to create a little script to get the different character strings.

Read more →

Split large data file into smaller data files

Problem

split_large_databasefile

The business uses a database that is 350 GB database in size and has only one data file and one transaction log file. The previous DBA didn’t increase the amount of data files which lead to a large data file. Due to the size of the data file, I got into trouble with the performance, and restoring the database wasn’t a walk in the park either. So how can split a large data file into smaller data files?

Read more →

Create indexes without DATAAREAID in Dynamics 2009

The problem

As I had an issue with the performance I wanted to create indexes without DATAREAID in Dynamics AX 2009.

noindex

The indexes didn’t have the DATAAREAID column which is automatically added to the index as the first column on creation.

Because the newly created indexes shouldn’t have this column in the first position I had a problem.
The second problem is that every time an update or synchronization takes place in Dynamics AX 2009 the database objects which are not part of the software architecture are removed.

Read more →

Resource Governor Pool Calculator

I was very interested in the new features of SQL 2008, especially the Resource Governor.

By implementing the Resource Governor you need to calculate the maximum shared and the calculated maximum. In the MSDN documentation “Resource Governor Concepts”, Microsoft explains how this can be calculated.

Because I like to let computers do as much for me automatically as possible I created an Excel document that calculates the values for you.

Read more →