SQL Server, T-SQL, Development, DBA and Career Resources

Human Created Content by Industry Experts for Developers, DBAs and Analytics Professionals

Returning XML Result Sets with SQL Server

With XML being used in so many application and data exchange capacities, extracting XML from SQL Server should not be a challenge. Yet, some organizations are building complex applications to do so and overlooking some of the native SQL Server features.

How and why should I use SQL Server 2005 synonyms?

Changing the name of an table once an application has been deployed has traditionally been a difficult task in SQL Server 2000. The typical solution in SQL Server 2000 for referencing a different object was to use a View. A second option was to use the

SQL Server Database Restores Mapping Users to Logins

When restoring a database to a different server there is often the problem of matching up logins and users. The reason for this is that login information is stored in the master database and user information is stored in the specific database you are wor

SQL Server Comparison Tools

There is often the need to compare both data and database structures from two databases either on the same server or on different servers. Most text editors have a built-in process to allow you to do a diff and identify any differences between the two fi

Index Builds in SQL Server 2000 vs SQL Server 2005

Among many other changes between SQL Server 2000 to 2005, the index creation code has some subtle changes that are important to know and handle appropriately in scripts. It is important to be aware of these changes due to the beneficial performance gains

How do I enforce SQL Server 2000 password changes?

One of the simplest security best practices is changing passwords on a regular basis. For some organizations that could be quarterly while others may have a more aggressive policy. Regardless of the policy, the issue remains the same, how can I enforce

COPY_ONLY Backups with SQL Server

One issue with creating backups is that the LSNs (log sequence numbers) get stored in the backup files and these LSNs are referenced when you do a restore of your database. With SQL Server 2005 a new backup option COPY_ONLY has been added that allows you

Getting a SQL Server RowCount Without doing a Table Scan

Sometimes there is a need to get record counts from every table in your database. One way of doing this is to do a SELECT count(*) on all of your tables, but this could create a lot of overhead especially for large databases and large tables. If you don'

Testing Options with SQL Server 2000 and 2005

Testing database applications for many organizations is a challenging task that is difficult to setup, automate and validate. Luckily, more time is getting allocated into development projects to conduct more rigorous testing. In this tip we will outline

SQL Server Agent Fixed Database Roles

One mantra across the industry is the need to fine tune security for all infrastructure components. In SQL Server 2005, Microsoft responded with an almost overwhelming number of granular security rights. One of these changes is with SQL Server Agent whi

SQL Server Instance Objects

SQL Server server related information is valuable for administrative scripts and very important when troubleshooting general configuration issues. In the transition from SQL Server 2000 to 2005, some of the objects and commands that we have grown to rely

System Monitor (Perfmon) Counters for SQL Server

Capturing performance monitor counters is of great value to understand how SQL Server is behaving. Without this data it is difficult to determine where the performance issues are occurring. Capturing the metrics has been traditionally from Performance Mo

Finding and troubleshooting SQL Server deadlocks

One thing that will you most certainly face at some time as a DBA is dealing with deadlocks. A deadlock occurs when two processes are trying to update the same record or set of records, but the processing is done in a different order and therefore SQL S