Database Engine, T-SQL

How to change the collation of a database in SQL Server?

Have you ever wondered how to change the collation for a database in SQL Server? Well the other day I received a database from a third party supplier and the first step was to change the Collation of the database. My questioning about why they would supply the database in the incorrect collation setting was… Continue reading How to change the collation of a database in SQL Server?

T-SQL

Statistical Aggregate functions in SQL Server

Have you ever wondered how to do program or perform simple statistical function within SQL Server? Well the kind people at Microsoft have enabled us to all to save time by giving us a few inbuilt functions which save us from having to solve them programmatically. I have used the unit Price column in the… Continue reading Statistical Aggregate functions in SQL Server

Database Engine, T-SQL

Change a database state in SQL

Have you ever wanted to change a databases state from read only to read write or vice versa? Well I am going to show you how using some easy to remember T-SQL which you will be using repeatedly over time.   We received a database from a client the other day and noticed one of… Continue reading Change a database state in SQL

Database Engine

List of DBCC commands in SQL Server

Have you wanted a list of DBCC commands to enable you to do a deep dive? Well I am going to list them out for you. Below is a list which complied after a discussion with a fellow DBA who said there were only about twenty whilst I was sure there were way more. We… Continue reading List of DBCC commands in SQL Server

Database Engine, DMV

SQL Server DMVs and DMFs categorised to make it easier to find information.

Have you wanted to find a DMV which would help give information about AlwaysOn Availability Group ,           Change Data Capture , Change Tracking ,Common Language Runtime , Database , Database Mirroring , Execution , Extended Events , Filestream, Full-Text Search and Semantic Search ,        I/O , Indexes , Object s, Query Notifications , Replication ,… Continue reading SQL Server DMVs and DMFs categorised to make it easier to find information.

Database Engine, T-SQL

How to list all SQL DMVs (Dynamic management views) s and DMFs (Dynamic management functions ) in SQL Server?

Have you ever wondered how many DMVs are in SQL? Wondered whether a DMV exists which help diagnose your problems? Well I am going to show you how to list all the DMVs and DMFs so that you can do a deeper dive into them or await my series where I will be exploring each… Continue reading How to list all SQL DMVs (Dynamic management views) s and DMFs (Dynamic management functions ) in SQL Server?

Database Engine, T-SQL

Easily Check Database Integrity (DBCC CHECKDB) For All Databases On A Server

Today I was doing my daily checks on one of my biggest SQL instances which has over 1,000 databases and noticed that SQL Agent was stopped. I couldn’t see any errors and was able to simply start it without any problems but I was concerned that the daily integrity check jobs had not run and… Continue reading Easily Check Database Integrity (DBCC CHECKDB) For All Databases On A Server

Database Engine

What are the SQL Server System databases?

SQL Server System databases SQL Server has 5 very default system databases which are Master MSDB Model TempDB Resource Master As the name implies this is one of the most important databases on the system and without it SQL Server will not start. It stores all the configuration of the instance and all other databases… Continue reading What are the SQL Server System databases?

Database Engine

How can I find out what SQL Server version is running?

I was asked by someone which SQL Server version a server was running and was surprised when my DBA colleague said to run a stored procedure I had never heard of.  I had not thought that there would be more than one way as the usual method I used below was so simple I didn't… Continue reading How can I find out what SQL Server version is running?