• Skip to main content
  • Skip to primary sidebar

DBA Diaries

Thoughts and experiences of a DBA working with SQL Server and MySQL

sql server 2012

T-SQL – Determine the Difference in Values Between Columns in Different Rows

June 21, 2015 by Andy Hayes Leave a Comment

Calculate Difference Between Columns in Different Rows

Have you ever needed to calculate the difference between columns in two or more rows in a table using a T-SQL query? For example you might want to run some trend analysis or audit data for changes. Thankfully using ROW_NUMBER() and Common Table Expressions (CTE's), this can easily be achieved. --create our table DECLARE @TableRows TABLE ( DateAdded SMALLDATETIME, Points … [Read more...] about T-SQL – Determine the Difference in Values Between Columns in Different Rows

SQL Server Certification – 2 for 1 exam offer

April 29, 2012 by Andy Hayes Leave a Comment

I came across this today and wanted to share it with you. If you are interested in SQL Server certification then for a limited time, Microsoft are offering "2 for 1" on SQL Server exams. Between April 11 2012 and June 30 2012, you can purchase a SQL Server exam at full price and then once you have taken it you will be emailed a voucher for the second exam at no additional … [Read more...] about SQL Server Certification – 2 for 1 exam offer

SQL Server Virtual Labs saves you time and resource

April 22, 2012 by Andy Hayes Leave a Comment

SQL Server Virtual Labs

If you have wanted to try SQL Server 2012 and learn about its new features but have not had the time or capacity to set yourself up a test environment then go over to SQL Server Virtual Labs where you can fire up SQL Server 2012 in an instant. At the time of writing this post, there is no cost involved in running these labs. They don't just cover SQL Server 2012, there are … [Read more...] about SQL Server Virtual Labs saves you time and resource

New T-SQL features in SQL Server 2012 – WITH RESULT SETS

April 21, 2012 by Andy Hayes Leave a Comment

sql server 2012 with result sets

New in SQL Server 2012 comes an extension to EXECUTE in the form of WITH RESULT SETS. WITH RESULT SETS allows column names and their data types to be changed in the result set of a stored procedure. My first thought with this improvement is that it could be very useful to have when building SSIS packages which read from a stored procedure as a data source. We'll take a … [Read more...] about New T-SQL features in SQL Server 2012 – WITH RESULT SETS

SQL Server covering index and key lookup performance

April 15, 2012 by Andy Hayes 7 Comments

covering index key lookup

In this post, I wanted to write about the covering index and key lookup and how adding covering indexes can help increase performance by reducing lookups to the table data. It's helpful to know what each of these terms mean and then we will look at an example scenario further down the post. What is a covering index? A covering index is a non-clustered index which includes … [Read more...] about SQL Server covering index and key lookup performance

Next Page »

Primary Sidebar

Categories

  • All Articles (82)
  • Career Development (8)
  • MySQL Administration (18)
  • MySQL Performance (2)
  • SQL Server Administration (24)
  • SQL Server News (3)
  • SQL Server Performance (14)
  • SQL Server Security (3)
  • SQL Tips and Tricks (19)

Top 10 Popular Posts

  • Using sp_change_users_login to fix SQL Server orphaned users
  • MySQL SHOW USERS? – How to List All MySQL Users and Privileges
  • How to shrink tempdb
  • How to Transfer Logins to Another SQL Server or Instance
  • How to Delete Millions of Rows using T-SQL with Reduced Impact
  • T-SQL – How to Select Top N Rows for Each Group Using ROW_NUMBER()
  • New T-SQL features in SQL Server 2012 – OFFSET and FETCH
  • How to Kill All MySQL Processes For a Specific User
  • Using exec sp_who2 to help with SQL Server troubleshooting
  • How to move tempdb

Recent Posts

  • How to Setup MySQL Master Master Replication
  • How To Use SQL to Convert a STRING to an INT
  • How to set up MySQL Replication Tutorial
  • How to Use SQL CASE for Conditional Logic in Your SQL Queries
  • Using ISNULL in SQL Server to Replace NULL Values

Search

Connect

  • Twitter
  • Facebook
  • Google+
  • RSS

About

  • Cookie Policy
  • Disclaimer
  • About
Copyright ©