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

Human Created Content by Industry Experts for Developers, DBAs and Analytics Professionals
Forcing Trigger Firing Order in SQL Server

Forcing Trigger Firing Order in SQL Server

I have two triggers defined on my table which are set to fire on the same table actions (i.e. an INSERT, DELETE, UPDATE transaction). The second trigger that fires is dependent on the first fired trigger. How can I make sure that they fire in the correc

Capturing SQL Identity Values in a SQL Server Database

When inserting a row into a database table that contains an identity column, I need a way to capture the identity value generated by the database engine after it inserts the row into this table. What can I use to capture this value while also making sure

Checklist to Re Architect a SQL Server Database

All systems generally follow the same basic life cycle from inception, development, maintenance and sun-setting. However, some systems seem to take a slightly different path where they are re-architected either in entirety or particular modules.

SQL Server Database Backup Retention Periods

As a best practice we issue full SQL Server database, differential and transaction log backups. We have setup a process to backup to local disks and then also copy the files to a centralized set of storage. On a weekly basis the centralized file system

Backing up SQL Server Data for Rollback Purposes

Many of our SQL Server releases include data changes, not just code changes. In some respects the SQL Server data changes are more of an issue to manage than the code changes. Unfortunately, when we change data by a percentage or make numerous changes i

Import Excel unicode data with SSIS

One problem that I have faced with importing data from Excel into a SQL Server table is the issue of having to convert data types from Unicode to non-Unicode. In this tip we show how this can be done.

Calculating Table Width in SQL Server

I am concerned our database design is overly denormalized. I believe we have some very wide tables which makes some of our coding very easy, but I am concerned about the data access and overall performance. Before I go too far down the path of just chan

Solid State Disk Drive Considerations for SQL Server

Are solid state disk drives really the next big thing? Will they be able to expand the IO needs of an application further than the current set of disk drive technologies? Is this a technology I should consider with my future SQL Server platforms? The r

Properly Sizing the SQL Server TempDB Database

Properly sizing the TempDB database has recently surfaced with some new customers and has also been a thread (http://blogs.mssqltips.com/forums/t/64.aspx) posted in the MSSQLTips forums. Here is the general scenario: On all of my SQL Server instances (de

UNION vs. UNION ALL in SQL Server

Sometimes there is a need to combine data from multiple tables or views into one comprehensive dataset. This may be for like tables within the same database or maybe there is a need to combine like data across databases or even across servers. I have rea

Index Usage Report in SQL Server

In a previous tip we looked at how to determine which indexes were being used for a SQL Server 2005 database. Databases have two primary storage needs; data pages and index pages. Understanding and viewing the actual data in your tables is pretty st