Alex Meyer-Gleaves

Setting your database Compatibility Level to match the SQL Server version

on sql server

It is not uncommon to have databases with a Compatibility Level that does not match the version of SQL Server they are running on. When you upgrade a SQL Server installation the databases retain a Compatibility Level that matches the version you upgraded from. The same applies to restoring or attaching databases from an earlier…

Limiting CTE recursion depth in SQL Server

on sql server

I can think of a few different cases that will result in the recursion of a CTE (Common Table Expression) in SQL Server coming to an end: You run out records to recursively select and your result is returned without error. You reach the default maximum recursion depth of 100 and an error occurs. You…

SQL Server 2008 SP1

on sql server

Service Pack 1 for SQL Server 2008 has been released and is available for download. The service pack offers very little in the way of features, but is instead comprised of a rollup of cumulative updates and bug fixes. There is a note on the download page that seems like it was put there to…

Renaming a computer running SQL Server

on sql server

You may have noticed that after renaming a computer running SQL Server that the value returned for @@SERVERNAME has not been updated. It returns the computer name as it was during installation of SQL Server. The SERVERPROPERTY function does take into consideration changes made to the computer name when the ServerName property is requested. To…