Posts by Brent Ozar

[Video] Office Hours at Sea: Heading to Jamaica

Videos
0
I’m on a boat! I’m on a 10-day Panama Canal cruise, and I stopped (well, not the boat) off the coast of Florida to answer questions y’all posted at https://pollgab.com/room/brento. 00:00 Start 00:56 DBe: In several places I’ve worked, it’s been “policy” to automatically restart heavy-use SQL servers off-hours on a regular cadence. Usually monthly…
Read More

Can You Nest Transactions in SQL Server?

T-SQL
5 Comments
To find out, let’s set up a simple status log table: DROP TABLE IF EXISTS dbo.StatusLog; CREATE TABLE dbo.StatusLog (TimeItHappened DATETIME2 PRIMARY KEY CLUSTERED, Step VARCHAR(20)); GO 123456 DROP TABLE IF EXISTS dbo.StatusLog; CREATE TABLE dbo.StatusLog     (TimeItHappened DATETIME2 PRIMARY KEY CLUSTERED,     Step VARCHAR(20));GO And then let’s try a two-part transaction: BEGIN TRAN INSERT INTO dbo.StatusLog VALUES…
Read More
Brent Reading Book

Find 40 Problems in This Stored Procedure.

T-SQL
Aaron Bertrand posted a challenge: We’re going to use the AdventureWorks sample database (get your copy here), where the folks in marketing requested a list of users to e-mail a new promotional campaign. The customers need to meet at least one of the following criteria: last placed an order more than a year ago placed…
Read More

[Video] Office Hours Brought to You by Quest Software

Videos
2 Comments
Today’s episode of Office Hours is brought to you by Quest Software. I went through your top-voted questions from PollGab.com/room/brento, and, uh, kinda looked like I was sponsored by Fendi while doing it, hahaha: Wow, those logos are bigger than I thought. Here’s what we covered: 00:00 Start 01:20 reluctantly_tolerant : I used FCI instead…
Read More

[Video] Office Hours: Ask Me Anything About SQL Server

Videos
0
Y’all post and upvote questions at https://pollgab.com/room/brento, and I stream sessions on my Twitch.tv channel where I answer ’em and chat with the audience. 00:00 Start 02:09 Chad Baldwin: Hey Brent! “a friend told me” MSSQL will use an index’s stats to generate a plan, but not use the index itself. 03:25 Jeremiah Daigle: Hey…
Read More

[Video] Office Hours: Quiet Sunday Edition

Videos
2 Comments
While waiting for the dry cleaner to open, I went live to stream a quiet session going through a bunch of y’all’s questions from https://pollgab.com/room/brento. Here’s what we covered: 00:00 Start 01:45 Rollback is single threaded: Hi Brent! In microservices application architecture, Using a database per service or a shared database? I asked this because…
Read More

Free Training Coming Up! March is PowerShell Month.

PowerShell
29 Comments
You’re a production database administrator responsible for the health, security, and uptime of many database servers. You’ve been pointing and clicking your way through SSMS for years, scripting out T-SQL to files, but… when you need to do the same task repeatedly across several servers, it’s a bit of a pain. You’ve told yourself someday…
Read More

[Video] Office Hours: Snowy Michigan Edition

Videos
3 Comments
We went up to Michigan to see my dad’s side of the family, and the snow came down just in time for our arrival. Always love the fresh snow look. So I stood outside and took your top-voted questions from https://pollgab.com/room/brento. Let’s see what y’all came up with today: Here’s what we covered: 00:00 Start…
Read More

[Video] Office Hours: 22 Good Questions and a Stinker

Videos
4 Comments
Lots of good questions on today’s broadcast! If you’d like to submit one, go to https://pollgab.com/room/brento and upvote the ones you’d like to see me cover. Here’s what we covered today: 00:00 Start 01:05 Testing123: When inserting or updating data into a table, from a concurrency perspective, does it make sense to break up the…
Read More

[Video] Office Hours: Quickie Before Dinner

Videos
0
Before heading out to dinner, I went through your highly-upvoted questions from https://pollgab.com/room/brento. Here’s what we covered in this episode: 00:00 Start 00:20 Mert: Hi Brent, what is the relation between AlwaysOn and Windows Failover Cluster? Is WFC an obligation or a choice for creating an Always On availability group? It will be nice if…
Read More

Office Hours, ChatGPT Edition: AI Answers 4 of Your Questions

In a recent Office Hours post, David Reabow suggested letting ChatGPT answer a few of the questions y’all posted at http://pollgab.com/room/brento/. Brilliant! Let’s see how it does. I purposely cherry-picked the questions that I thought ChatGPT would have the easiest time answering. Rollback is single threaded asks: Hi Brent! An update statement has blocked all…
Read More

[Video] Office Hours: Ten Minutes of SQL Server Answers

Videos
2 Comments
ChatGPT, Resource Governor, manually created stats, Always Encrypted, and as always, fragmentation: let’s answer your questions from https://pollgab.com/room/brento. Here’s what we covered today: 00:00 Start 01:13 Timbalero: Hi Brent. my friend knows your view on rebuilding indexes. He also thinks that external index fragmentation affects pretty much only readahead scans. For scientific purposes, what metrics…
Read More