Microsoft SQL Server Extended Events, a replacement for SQL Trace, provides a useful and very customizable framework for managing very technical, low-level event information about a SQL Server database and its instances. However...
On June 5, 2006 MSSQLTips.com started with just one tip in an effort to offer solutions to real world SQL Server problems. Ten years later, we never expected MSSQLTips.com to grow into a global community of millions of SQL Server Professionals.
In my T-SQL code I always use set based operations. I have been told these types of operations are what SQL Server is designed to process and it should be quicker than serial processing. I know cursors exist but I am not sure how to use them. Can you p
I have an application that has a specified database connection that I either can't or don't want to change. However, I need to move the database to a new server. How can I do this easily without breaking other things that maybe using this connection and/o
We are implementing our first Master Data Services (MDS) model and want to make sure that users cannot enter data that does not comply with certain business requirements. Read this tip to learn how to build business rules for MDS.
I have a dataset where I need to find the minimum and maximum values in a SQL Server table. In the case where multiple rows contain the same minimum or maximum value I only want to select the first occurrence. Read this tip to learn how.
Sometimes as a DBA we need to generate a T-SQL script for dropping and creating indexes in our SQL Server databases. However, SQL Server Management Studio does not have an easy way via the wizard to complete these tasks all at the same time. In this tip,
This paper demystifies query tuning by providing a rigorous 12-step process that database professionals at any level can use to systematically assess and adjust query performance, starting from the basics and moving to advanced query tuning techniques.
Amazon EC2 offers another option for putting SQL Server in the cloud. It is easy to setup, upgrade and you are only charged when the box is in use. Let's take a look at how to use Amazon EC2 for SQL Server.
SQL Server database files have two names: one is the logical file name and the other is the physical file name. In this tip we will look at how to see the logical database file names and also how to rename the logical files.
A common concern or response we hear post interview is I wasn't ready for that level of a technical interview or I didn't do as well on the technical questions as I would've liked. Read this tip to learn how to be prepared.
As a database developer or tester sometimes you need to have production like data in your environment for your development or testing, but you cannot have the production data because of security and privacy issues. In this tip, we look at how to use the t
With a new release of SQL Server (SQL Server 2016) comes also a new sample database. The days of AdventureWorks are over, here's Wide World Importers! This tip gives an overview of how you can install these new sample databases on your system.
During your work as SQL Server DBA, you might need to create a copy of a production database to simulate testing scenarios on the production schema and statistics. Read this tip to learn about how to use DBCC CLONEDATABASE to make a database copy with jus