Categories
SQL Server

Implementing DML Triggers

Last time out we looked at implementing DDL triggers in SQL Server and today we’re going to look at the other commonly used trigger – DML. What are DML triggers DML triggers are used to react to events caused by data manipulation language (DML) statements. These events are targeted to a specific table or view and so […]

Categories
SQL Server

Implementing DDL Triggers

In SQL Server we have the ability to create triggers to respond to events occurring within our databases or across the server. These typically come in two varieties – DDL and DML triggers. Here we’ll look at what DDL triggers are and how to implement them. What are DDL triggers A DDL trigger is a […]

Categories
SQL

Naming Scope in SQL Server

When creating items in SQL Server we aren’t able to create multiple with the same name, for example two tables named dbo.Sales. Similarly we couldn’t create a table and view with the same name. However it isn’t the case that everything we create within a database has to be named uniquely. It can depend on […]

Categories
T-SQL Tuesday

T-SQL Tuesday #161: Having Fun with T-SQL

It’s that time of the month again and this invitation from Reitse has asked us about some fun we’ve had with T-SQL in the past. Whilst I’ve used SQL Server over the years and it’s features as part of various solutions for others, I enjoy the time I can put it to work for solving […]

Categories
SQL

Performance Enhancements for Vertical Partitioning

We’ve previously looked at how to implement vertical partitioning and the benefits it can bring within our data. Here I’d like to dive a little further into improving the performance even further with a couple of modifications to our schema. We’ll use the same setup as we had previously to create the table, populate it and partition it. This results in […]

Categories
SQL

Benefits of Vertical Partitioning

We recently looked at implementing vertical partitioning on a set of data. In an earlier introduction post we also mentioned the benefits which can be seen as a result of the partitioning in both our maintenance and querying of the data. Here we’ll take a look at those benefits with a little more evidence. We’ll be using the data […]

Categories
SQL Server

Boolean Value Storage

Within SQL Server we can store Boolean data using the BIT data type. This value is a single bit which will store a True or False (or null) value. However if you dive a little deeper with the data type it’s actually a little less clear cut in terms of the storage needed for this data type. […]

Categories
T-SQL Tuesday

T-SQL Tuesday #160: Microsoft OpenAI Wishlist

For March’s T-SQL Tuesday invitation, Damien has asked us to consider a wish list for Microsoft’s partnership with OpenAI. AI has been a hot topic in recent months, largely due to the attention from tools such as ChatGPT and DALL-E from OpenAI. These tools and future iterations or derivatives will almost inevitably shape the way […]

Categories
SQL

Implementing Vertical Partitioning

We previously looked at an introduction to Vertical Partitioning where we covered what it is and the potential benefits and drawbacks of using it. Here I wanted to build up some data and show how we may vertically partition it to help make it more manageable for us. So that we’ve got some relevant data to use […]

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 […]