Categories
SQL

Checking Data Types for Stored Procedure Results

When executing stored procedures it may appear simple enough to infer the data types which are being returned. However if those data types aren’t what you’d expect this could have downstream implications for the apps which are consuming the data. If we want to look at data in a table or view we can use […]

Categories
SQL

Introduction to Vertical Partitioning

When dealing with large volumes of data in SQL Server we may need to look for strategies to make querying and managing the data easier to handle. A few months back we looked at an approach where we partitioned our data into multiple segments by applying partition functions and schemes to our tables. This helps […]

Categories
SQL

Changing Identity from INT to BIGINT

When creating tables we may choose to use an INT column with an IDENTITY set as a unique clustering value. On occasions we find out that being able to store 2,147,483,647 records just isn’t enough and we need to change this field to be a BIGINT to let us store… well, a lot more. Here I’ll outline one approach which could […]

Categories
SQL

Querying with Aliases

When writing larger queries which return more fields or join together an increasing number of tables it can be easy for scripts to get unruly. A fundamental skill to help with the readablity of you queries is through the use of Aliases. An alias provides us a was to change how we reference part of […]