Sometimes we need to update data in one table based on the contents of one or more other tables. Discover how the UPDATE from SELECT variation of SQL Server’s UPDATE statement provides an easy way to achieve this.
Don’t get caught in this nasty trap that will cause all your encrypted data to be wiped out. Discover how to use the OPEN SYMMETRIC KEY statement correctly to protect yourself (and your data) from this ugly surprise.
One of the most often encountered concurrency problems in T-SQL code happens in the Insert or Use scenario in which a new row is inserted if it does not exist yet and afterwards the primary key of the existing or the new row is returned. One of the easiest and safest ways to get this right is provided by the MERGE statement.
While ANSI-92 joins have been around for over 20 years and the pre-ANSI-92 join syntax has been deprecated 4 SQL Server versions ago, it is still in use today. This article provides guidance on how to rewrite those old queries into the “new” outer form.
SQL Server 2008 introduced a single statement insert-update-delete: MERGE. This article introduces this statement, explains how it works and shows that it is really a full outer join under the covers.