Blog

Backup Databases with PowerShell and dbatools

Keeping on the recent PowerShell trend, let’s use PowerShell to accomplish a primary task of any database administrator: backups. With PowerShell and dbatools, you can do a simple backup or add a range of options to fit your needs. Starter Backup Let’s start out with taking a basic database backup using Backup-DBADatabase from dbatools. We’ll…

T-SQL Tuesday #160: Microsoft OpenAI Wishlist

Our T-SQL Tuesday topic for this month comes from Damien Jones who asks us about our wishlist for Microsoft OpenAI. AI has been a hot topic in the last few months. Some see it as the next best thing while others are a bit more fearful. I think the answer is somewhere in the middle.…

Combine CSV Files Using PowerShell

I recently had a handful of CVS files that needed reviewed. Each CSV file was the same format, and while I could have opened them each individually to sort and review, I thought it would be much easier to combine them into one file. It was time to turn to PowerShell. Let’s look at a…

Save Time Counting, Use IF EXISTS

When checking for the existence of a value or values in a table, typically, the whole table does not need to be read. The goal is to obtain more of a true or false answer, whether a criteria is met or not. If the criteria is met with the first few records then there’s no…

A Permission Predicament

I recently encountered an unusual permissions issue with multiple databases. New databases were not including all of the permissions that were supposed to be set following database restores. At the time, I wasn’t sure if the permission was being granted and then revoked or not granted at all. I wanted a script I could run…

T-SQL Tuesday #159 – Optimizing for the Year

The T-SQL Tuesday #159 invitation comes from Deepthi Goguri who has not one, but two invitation topics. First, what is a favorite SQL Server 2022 or Azure feature? Second, how are we managing to stick with New Year Resolutions? To check out the full invitation, click the T-SQL Tuesday logo. New SQL Server 2022 Feature…

OPTIMIZE_FOR_SEQUENTIAL_KEY – The Key to Success?

If you’re running into problems caused by concurrent inserts and you’re on SQL Server 2019 or above, it’s worth testing out OPTIMIZE_FOR_SEQUENTIAL_KEY. This may alleviate those issues by handling inserts a little bit differently to reduce contention. OPTIMIZE_FOR_SEQUENTIAL_KEY will “control the rate at which new threads are allowed to request the latch, and favor threads…

Troubleshooting an Always Encrypted Certificate Error

The benefit of SQL Server Always Encrypted is to encrypt sensitive data in specified columns to prevent it from being seen by unauthorized users. It is a great feature, but there are some steps to consider besides the SQL setup side. What if you are one of the lucky (or unlucky) users who should have…

Don’t Miss Out – Learn PowerShell

PowerShell is a command-line interface and scripting language that is useful for automating and optimizing a variety of processes. As time goes on, PowerShell gets more and more useful for database administrators. While there is plenty of depth to PowerShell, I would argue that gaining the knowledge necessary to perform powerful tasks does not require…

When SSMS Thinks It’s Helping, But It’s Not

Sometimes, you can run into problems where you can’t believe what you’re seeing. I recently went through one of those times. How could a seemingly insignificant change to a stored procedure cause me so much frustration? The task was about as simple as could be: commenting out a section of a stored procedure that’s not…

Loading…

Something went wrong. Please refresh the page and/or try again.


Follow My Blog

Get new content delivered directly to your inbox.