A few weeks back we looked at altering an object inside our database and changing the schema in which it resides. Whilst the ALTER SCHEMA … TRANSFER statement itself is straightforward, there are some gotchas you might find as a result of the change which I thought it was worth covering. To set up for what we’re going […]
Tag: SQL
Last time out we looked at referencing tables across databases. While we of course have the option of using three-part naming to address the table, we also considered views and synonyms as two alternative options. Both of these can be used to achieve similar results. There are elements which they have in common and others which […]
Referencing Cross-Database Objects
In SQL Server we’ll typically end up using environments containing multiple databases which happen to have data which relate to each other. Due to this there will be times when we’ll need to reference objects in another database when writing a query. What options do we have for doing this? Here we’ll look at three […]
This months’ invitation from Steve Jones asks us to write about producing SQL dynamically in some form or another. We can create and execute SQL dynamically within our procedures but what about dynamically creating it from other sources before passing it into SQL Server? The quick I have to admit that Steve’s mention of using Excel […]
Changing Object Schema in SQL Server
We’ve previously looked at the basics of using schemas in SQL Server where we created a schema and used objects inside of it. If you’re not dealing with new objects though and wanted to move something into or out of a schema how to we go about that? Not by renaming it For renaming most objects within […]
T-SQL Tuesday #152 – It Depends
As Deborah’s invitation opens this month she quite rightly points out that there are a lot of professionals out there who have a few (passionate) opinions about what they do or the way they do it. This month we’re invited to … well, have a rant – a rant about those experiences which have shaped […]
Following on from previous posts where we looked at Dynamic Data Masking, how to use it, and the challenges we may encounter, there’s one last area I wanted to touch on. With the arrival of SQL Server 2022 the masking functionality has been extended so we have an additional masking function and more granular permissions […]
Challenges with Dynamic Data Masking
Recently we’ve been looking at Dynamic Data Masking and what it can achieve for us. With that said however, there are some drawbacks to how it works which its worth being aware of before you consider implementing it. Even in the official documentation it states that the feature “limits” exposure, can be used to “simplify” design, and […]
Dynamic Data Masking Patterns
When we initially looked at Dynamic Data Masking we used the default function to mask our data so it showed xxxx. With the masking however there are a few functions available to allow us to mask data in particular ways which may be of use depending on our use case. We’ll create a record to apply these masks against so […]
This month’s invitation comes from Mala who asks us about the T-SQL coding rules relevant for where we work. There’s certainly a lot of scope in this question and Mala links to a great set of posts from Robert Sheldon which cover quite a number of these points. Whilst larger businesses may well have matured standards in […]