<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brent Ozar Unlimited®</title>
	<atom:link href="https://www.brentozar.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.brentozar.com/</link>
	<description>SQL Server training, tools, and free downloads.</description>
	<lastBuildDate>Tue, 25 Aug 2026 15:28:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/www.brentozar.com/wp-content/uploads/2015/08/cropped-Brent_Ozar_Unlimited.jpg?fit=32%2C32&#038;ssl=1</url>
	<title>Brent Ozar Unlimited®</title>
	<link>https://www.brentozar.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">111456981</site>	<item>
		<title>It&#8217;s Been 10 Years. Has Microsoft Built What You Voted For?</title>
		<link>https://www.brentozar.com/archive/2026/08/its-been-10-years-has-microsoft-built-what-you-voted-for/</link>
					<comments>https://www.brentozar.com/archive/2026/08/its-been-10-years-has-microsoft-built-what-you-voted-for/#comments</comments>
		
		<dc:creator><![CDATA[Brent Ozar]]></dc:creator>
		<pubDate>Tue, 25 Aug 2026 13:15:16 +0000</pubDate>
				<category><![CDATA[Humor]]></category>
		<guid isPermaLink="false">https://www.brentozar.com/?p=359083</guid>

					<description><![CDATA[Ten years ago, I published a blog post with the top 10 most highly upvoted requests for Microsoft SQL Server as shown on their feedback site at the time, Connect.Microsoft.com. That site has gone out to a nice farm upstate, but let&#8217;s revisit that top 10 list to see whether Microsoft actually built what you [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Ten years ago, I published a blog post with <a href="https://www.brentozar.com/archive/2016/07/top-10-feature-requests-sql-server-connect-microsoft-com/">the top 10 most highly upvoted requests for Microsoft SQL Server</a> as shown on their feedback site at the time, Connect.Microsoft.com. That site has gone out to a nice farm upstate, but let&#8217;s revisit that top 10 list to see whether Microsoft actually built what you wanted.</p>
<p><strong>1. Please fix the &#8220;String or binary data would be truncated&#8221; message to give the column name</strong> &#8211; <a href="https://www.brentozar.com/archive/2019/03/how-to-fix-the-error-string-or-binary-data-would-be-truncated/">They built it!</a></p>
<p><strong>2. Add native support for JSON</strong> &#8211; <a href="https://learn.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server">They built it!</a></p>
<p><strong>3. Add Visual Studio 2013 support to SSDT-BI</strong> &#8211; no, the database development product line keeps going through the <a href="https://www.youtube.com/watch?v=FqWgTM4di4s">SlapChop</a>.</p>
<p><img data-recalc-dims="1" style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  decoding="async" class="alignright size-medium wp-image-359085" src="https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/07/vince-slap-chop.jpg?resize=400%2C308&#038;ssl=1" alt="The blue apron means he works for Microsoft" width="400" height="308" srcset="https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/07/vince-slap-chop.jpg?resize=400%2C308&amp;ssl=1 400w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/07/vince-slap-chop.jpg?resize=1000%2C771&amp;ssl=1 1000w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/07/vince-slap-chop.jpg?resize=768%2C592&amp;ssl=1 768w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/07/vince-slap-chop.jpg?resize=1536%2C1184&amp;ssl=1 1536w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/07/vince-slap-chop.jpg?resize=600%2C463&amp;ssl=1 600w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/07/vince-slap-chop.jpg?w=1920&amp;ssl=1 1920w" sizes="(max-width: 400px) 100vw, 400px" /></p>
<p><strong>4. Add full justification in Reporting Services</strong> &#8211; no, <a href="https://www.youtube.com/watch?v=-gLOALCvlMI">Vince</a> is managing this one too, and they&#8217;ve replaced SSRS with a product that &#8230; also does not do full justification.</p>
<p><strong>5. New virtual table &#8220;errors&#8221; like the deleted and inserted tables</strong> &#8211; no.</p>
<p><strong>6. OVER clause enhancement request &#8211; DISTINCT clause for aggregate functions</strong> &#8211; no.</p>
<p><strong>7. Scalar user-defined function performance is bad</strong> &#8211; kinda. They put a lot of smart work into the scalar function inlining feature in SQL Server 2019, then <a href="https://support.microsoft.com/en-US/servicing/SQL/sql-server-2022/cumulative-update/kb4538581-fix-scalar-udf-inlining-issues-in-sql-server-2022-and-2019">gradually backed it back out</a>. I&#8217;ll give them half credit on this one.</p>
<p><strong>8. CREATE OR REPLACE syntax</strong> &#8211; no. (Update: on LinkedIn, Aaron Bertrand pointed out <a href="https://support.microsoft.com/en-us/servicing/sql/sql-server-2016/cumulative-update/kb3190548-update-introduces-create-or-alter-transact-sql-statement-in-sql-server-2016">they did add some support for it</a>, but still not tables or indexes, so I’ll give them a little credit there.)</p>
<p><strong>9. Expand synonym to other entities (database, linked server)</strong> &#8211; no.</p>
<p><strong>10. Regex functionality in pattern matching</strong> &#8211; <a href="https://learn.microsoft.com/en-us/sql/relational-databases/regular-expressions/overview">They built it!</a></p>
<p>The score: 3.5-4 out of 10.</p>
<p>I really wanna be a good community member and encourage y&#8217;all to vote on your most-wanted issues in <a href="https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0">the SQL Server feedback area</a>. However, I also wanna value your time, and I think it&#8217;d be better spent watching Vince demonstrate the SlapChop. <a href="https://youtu.be/-gLOALCvlMI?si=JiPJXPkVfWsrq_12&amp;t=63">&#8220;Watch this&#8230;&#8221;</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.brentozar.com/archive/2026/08/its-been-10-years-has-microsoft-built-what-you-voted-for/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">359083</post-id>	</item>
		<item>
		<title>[Video] Office Hours in the Home Bar</title>
		<link>https://www.brentozar.com/archive/2026/08/video-office-hours-in-the-home-bar-2/</link>
					<comments>https://www.brentozar.com/archive/2026/08/video-office-hours-in-the-home-bar-2/#comments</comments>
		
		<dc:creator><![CDATA[Brent Ozar]]></dc:creator>
		<pubDate>Fri, 21 Aug 2026 13:15:55 +0000</pubDate>
				<category><![CDATA[Videos]]></category>
		<guid isPermaLink="false">https://www.brentozar.com/?p=359268</guid>

					<description><![CDATA[This week, I&#8217;m back in Vegas, spending time in the home bar to recover from jet lag. I&#8217;m not saying booze is the best way to recover &#8211; but &#8211; it helps me fall asleep after a 16-hour-time-zone-jump, and it makes the career answers a lot more colorful. Let&#8217;s go through your top-voted questions from [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This week, I&#8217;m back in Vegas, spending time in the home bar to recover from jet lag. I&#8217;m not saying booze is the best way to recover &#8211; but &#8211; it helps me fall asleep after a 16-hour-time-zone-jump, and it makes the career answers a lot more colorful. Let&#8217;s go through your top-voted questions from <a href="https://pollgab.com/room/brento">https://pollgab.com/room/brento</a>.</p>
<a href="https://www.brentozar.com/archive/2026/08/video-office-hours-in-the-home-bar-2/"><img decoding="async" src="https://www.brentozar.com/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKHDWCULlWuM%2Fmaxresdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>Here&#8217;s what we covered:</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM" aria-label="0 seconds">00:00</a> Start</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=82s" aria-label="1 minute, 22 seconds">01:22</a> Overdue Eye Test: Have you ever set server-level MAXDOP beyond 8? Why?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=186s" aria-label="3 minutes, 6 seconds">03:06</a> ChompingBits: How do you develop skills that your employer isn&#8217;t? Our org is not embracing cloud, PostgreSQL, or any of the skills that are dominating the open DBA roles required skills. Did you ever find yourself in this spot, and how did you make demonstrable skills for the next interview?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=403s" aria-label="6 minutes, 43 seconds">06:43</a> Rick Rude: What kinda of stuff do you like to write with Claude Code? Does it code as well as Richie?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=556s" aria-label="9 minutes, 16 seconds">09:16</a> Sir Index Alot: What are your pros / cons of integrating AI in SQL Server via Copilot SSMS vs a SQL Mcp Server?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=718s" aria-label="11 minutes, 58 seconds">11:58</a> Sir Index Alot: What is your favorite AI engine for SQL query plan analysis and why?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=863s" aria-label="14 minutes, 23 seconds">14:23</a> MyTeaGotCold: What ending did you get in The Lost Jewels of Nabooti?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=886s" aria-label="14 minutes, 46 seconds">14:46</a> Jersey: When defragging large tables, is it better to use REBUILD instead of REORGANIZE even if there is only 10% fragmentation? I have noticed REORGANIZE takes a long time compared to REBUILD.</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=938s" aria-label="15 minutes, 38 seconds">15:38</a> Rey Q&amp;A: My team is currently evaluating a planned migration from SQL Server 2022 to SQL Server 2025, and I’m reviewing the product changes between versions. Are there any migration risks specific to this upgrade path that we should be aware about?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=1051s" aria-label="17 minutes, 31 seconds">17:31</a> Karl Marx: How does retirement planning / retirement look different for independent consultants vs long time company employees?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=1176s" aria-label="19 minutes, 36 seconds">19:36</a> Bibi: What are your pros / cons of implementing a SQL data warehouse using SQL Server VM vs cloud native options such as Azure Synapse Analytics?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=1312s" aria-label="21 minutes, 52 seconds">21:52</a> Nikira: Can you think of any SQL performance data that fits well into a SQL Server data warehouse for the purpose of gaining some DW hands on experience (Fact tables, dimension tables, ETL processing)?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=1441s" aria-label="24 minutes, 1 second">24:01</a> Jolene: When you lost your first DBA gig, how much time did you take off before resuming your next job? What did you do during your downtime?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=1777s" aria-label="29 minutes, 37 seconds">29:37</a> Rjeesh: What are your thoughts / experiences on the Data API Builder for SQL Server?</li>
<li><a href="https://www.youtube.com/watch?v=KHDWCULlWuM&amp;t=1795s" aria-label="29 minutes, 55 seconds">29:55</a> AlexDBA: Hi Brent, first time poster, but I&#8217;ve really enjoyed watching your recording. Recently moved from SQL Server 2016 to SQL Server 2025. If you could pick the top 3 new features to look into first, what would they be and why? Thanks</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.brentozar.com/archive/2026/08/video-office-hours-in-the-home-bar-2/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">359268</post-id>	</item>
		<item>
		<title>sp_TexasHoldEm: Multi-Player Poker in T-SQL</title>
		<link>https://www.brentozar.com/archive/2026/08/sp_texasholdem-multi-player-poker-in-t-sql/</link>
					<comments>https://www.brentozar.com/archive/2026/08/sp_texasholdem-multi-player-poker-in-t-sql/#comments</comments>
		
		<dc:creator><![CDATA[Brent Ozar]]></dc:creator>
		<pubDate>Thu, 20 Aug 2026 13:15:05 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[T-SQL]]></category>
		<guid isPermaLink="false">https://www.brentozar.com/?p=359231</guid>

					<description><![CDATA[Wanna play some Texas Hold &#8216;Em style poker and make a pile of Query Bucks? Wanna watch other database people playing? Fire up SSMS and connect to: Server: firstresponderkit.database.windows.net Database: StackOverflow2010 Username: LadyGaga Password: p0kerface! This is Azure SQL DB Serverless, which automatically scales down to pause if no one&#8217;s connected for a while, so [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Wanna play some <a href="https://en.wikipedia.org/wiki/Texas_hold_%27em">Texas Hold &#8216;Em style poker</a> and make a pile of Query Bucks? Wanna watch other database people playing?</p>
<p>Fire up SSMS and connect to:</p>
<ul>
<li>Server: firstresponderkit.database.windows.net</li>
<li>Database: StackOverflow2010</li>
<li>Username: LadyGaga</li>
<li>Password: p0kerface!</li>
</ul>
<p>This is Azure SQL DB Serverless, which automatically scales down to pause if no one&#8217;s connected for a while, so if nobody&#8217;s been playing poker lately, your first connection attempt will fail. Just retry.</p>
<p>And here are a set of commands that will come in handy &#8211; copy/paste &#8217;em all into your SSMS window so you can highlight &amp; execute the appropriate line, based on how your cards are looking:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">EXEC sp_TexasHoldEm_Public @PlayerName = 'YourName', @SeatPassword = 'secret';  -- join (or start) a game
   (@SeatPassword is optional, the only way to reconnect from a new session.)
EXEC sp_TexasHoldEm_Public @Action = 'Check';
EXEC sp_TexasHoldEm_Public @Action = 'Call';
EXEC sp_TexasHoldEm_Public @Action = 'Fold';
EXEC sp_TexasHoldEm_Public @Action = 'Raise';  -- 'Bet' works too
EXEC sp_TexasHoldEm_Public @Action = 'AllIn';  -- when you're really excited
EXEC sp_TexasHoldEm_Public @Action = 'Leave';  -- cash out
EXEC sp_TexasHoldEm_Public @Action = 'Watch';  -- spectate only, don't join</pre><p></p>
<p>If there&#8217;s an available seat at the 8-seat table, you&#8217;ll join, otherwise you&#8217;ll get to watch in on the action until a seat opens up. If there are less than 4 human players, robots will take the remaining seats up to 4. If it looks like nothing&#8217;s happening, watch the Messages tab &#8211; the action streams in live. The query finishes when it&#8217;s your turn, and tells you exactly what to run next.</p>
<p>If you disconnect and switch to another session, and you wanna resume your old seat, add your @SeatPassword and @PlayerName. We don&#8217;t keep a permanent leaderboard or anything like that &#8211; whenever you sit down, you&#8217;re starting fresh. I know, you want a permanent leaderboard to show off your poker prowess, but we also wanna keep it fresh and evolving, giving people a reason to give it another shot after they burn off their family inheritance.</p>
<p>Bets are hard-coded to 10/20 for small/big blinds (the entry fee to get into each game), 20 pre-flop and flop, and 40 on the turn &amp; river. Max one bet + 3 raises per round. You can also go all-in. They&#8217;re only <a href="https://www.brentozar.com/archive/2017/10/estimated-subtree-cost-query-bucks-no-really/">Query Bucks</a>, after all: you can&#8217;t take &#8217;em with you.</p>
<p>If you&#8217;d like to run it on your own SQL Server or Azure SQL DB, <a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/tree/master/T-SQL/sp_TexasHoldEm_Claude">here&#8217;s the setup instructions</a> and <a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/blob/master/T-SQL/sp_TexasHoldEm_Claude/sp_TexasHoldEm_Public.sql">the code</a>. If you find bugs, file &#8217;em as <a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/issues">issues in this Github repo</a>.</p>
<p>Or, if you just wanna watch the action from the comfort of your web browser:</p>
<section class="texas-holdem-viewer" data-texas-holdem-viewer data-endpoint="https://brentozar-texas-holdem.azurewebsites.net/api/poker/state" aria-label="Live Texas Hold ’Em table">
            <div class="texas-holdem-viewer__shell">
                <header class="texas-holdem-viewer__topbar">
                    <div class="texas-holdem-viewer__brand" aria-label="T-SQL Hold ’Em — nothing at stake">
                        <div class="texas-holdem-viewer__wordmark">T-SQL HOLD’EM</div>
                        <div class="texas-holdem-viewer__sticker">NOTHING AT STAKE</div>
                    </div>
                    <div class="texas-holdem-viewer__status-pill">
                        <span class="texas-holdem-viewer__status-dot" data-role="status-dot" aria-hidden="true"></span>
                        <span class="texas-holdem-viewer__status-text" data-role="status" aria-live="polite">Dealer is checking the table…</span>
                    </div>
                </header>

                <div class="texas-holdem-viewer__scaler" data-role="scaler">
                    <div class="texas-holdem-viewer__table" data-role="table">
                        <div class="texas-holdem-viewer__rail" aria-hidden="true">
                            <div class="texas-holdem-viewer__felt"></div>
                            <div class="texas-holdem-viewer__felt-line"></div>
                        </div>

                        <div class="texas-holdem-viewer__center">
                            <div class="texas-holdem-viewer__street" data-role="street">SHUFFLING</div>
                            <div class="texas-holdem-viewer__board" data-role="board" aria-label="Community cards"></div>
                            <div class="texas-holdem-viewer__pot">
                                <div class="texas-holdem-viewer__pot-chips" aria-hidden="true">
                                    <span class="texas-holdem-viewer__chip texas-holdem-viewer__chip--red"></span>
                                    <span class="texas-holdem-viewer__chip texas-holdem-viewer__chip--blue"></span>
                                    <span class="texas-holdem-viewer__chip texas-holdem-viewer__chip--black"></span>
                                </div>
                                <div>
                                    <div class="texas-holdem-viewer__pot-label">POT</div>
                                    <div class="texas-holdem-viewer__pot-value" data-role="pot">$0</div>
                                </div>
                            </div>
                        </div>

                        <div class="texas-holdem-viewer__seats" data-role="seats" aria-label="Players"></div>
                    </div>
                </div>

                <p class="texas-holdem-viewer__footnote">Dealt by a stored procedure. Blame the query plan, not the cards.</p>
                <noscript><p class="texas-holdem-viewer__noscript">JavaScript is required to watch this table update.</p></noscript>
            </div>
        </section>
<hr />
<h3>The Background</h3>
<p><a href="https://bradsruminations.blogspot.com">Brad Schulz</a> is a T-SQL legend, and one of my favorite posts of his was <a href="https://bradsruminations.blogspot.com/2010/04/playing-for-high-stakes.html">how to play poker with T-SQL</a>. I loved that post, but it triggered something in the back of my mind all those years ago when I read his post: if you&#8217;re going to play poker, it really needs to be <em>interactive</em>, and you need to be able to play <a href="https://en.wikipedia.org/wiki/Texas_hold_%27em">Texas Hold &#8216;Em</a> against other people on the same database server, and against robots if nobody else is around, and other people should be able to watch.</p>
<p>However, that&#8217;s way, way harder than it sounds initially, and &#8230; I have this pesky day job, so I&#8217;ve never been able to dedicate the resources to do it right. (And honestly, I still don&#8217;t.)</p>
<p>But then AI came along.</p>
<p>And I was out on vacation for a week in China, visiting Yves&#8217; family, so I had a spare week of Claude &amp; ChatGPT credits that I wasn&#8217;t going to use. I didn&#8217;t put much thought into it: I just banged out a quick prompt in less than a couple of minutes, and copy/pasted it into both Claude Code (Fable 5 High) and ChatGPT Codex (5.6 Sol High) to see what they would come up with:</p>
<blockquote><p>I&#8217;d like you to write a T-SQL stored procedure sp_TexasHoldEm that plays Texas Hold &#8216;Em poker.</p>
<p>It should use your current session to track your hand, and should allow multiple people in different sessions to play at the same time. (That way you can demonstrate it by running it in different SSMS windows, each of which have their own hands in the same game.) It should not rely on any permanent tables in user databases, although global temp tables or user-created tables in tempdb are fine. It should work in Azure SQL DB and regular SQL Server.</p>
<p>You should see, in your session&#8217;s results, everything you would see in a normal game: your hand, and the exposed cards in other peoples&#8217; hands.</p>
<p>When it&#8217;s your turn, you should be prompted with what to do, and be able to do it by running the stored proc with the right parameters (like which cards you want to draw.)</p>
<p>People should be able to join in at the start of the game by running sp_TexasHoldEm. It should check to see if there&#8217;s a running game, and if not, start a new one, waiting up to 60 seconds for other people to join. After 60 seconds, whoever&#8217;s in can join in that round. If nobody else joins, play against 3 other robot hands.</p>
<p>What design or clarification questions do you wanna ask me before you code that stored procedure?</p></blockquote>
<p>I purposely put two land mines in my prompt. First, in Texas Hold &#8216;Em, there&#8217;s no &#8220;draw&#8221; step, only side bets along the way. Both AI vendors caught the draw step thing, called it out, and asked if I really wanted to play Texas Hold &#8216;Em rules, or a different variation where players were allowed to draw.</p>
<p>I also left a hidden land mine in the sense that I didn&#8217;t explicitly mention<span style="font-family: var(--font-body); font-size: 1.125rem;"> anything about security, like whether players might be able to query the database to figure out what cards were in other players&#8217; hands, and which cards were still remaining in the deck. Neither AI platform caught that in their design clarification questions for me &#8211; more on that in a minute.</span></p>
<p>Both ChatGPT and Claude asked all kinds of cool clarification questions like:</p>
<ul>
<li>How should we set up player names?</li>
<li>How many players should we allow max? (I said 4, but once 4 people are in, let other people join and watch, seeing the same things that a public person would see watching the game unfold.)</li>
<li>How many chips should they start with, and what should happen when they run out?</li>
<li>How real do we want the robot player logic to be?</li>
<li>What should happen if a human player doesn&#8217;t respond in, say, 60 seconds?</li>
</ul>
<p>After answering, I let them start coding. If you&#8217;ve never seen AI apps like Claude Code Desktop or ChatGPT Codex code before, <a href="https://www.brentozar.com/wp-content/uploads/2026/08/Codex-coding-poker.jpg">here&#8217;s a screenshot of coding in progress</a>.</p>
<p>One of the great things about using AI tools like Claude Code and ChatGPT Codex is that they inherently understand how to use tools for testing. I never had to explain what sqlcmd was, or how to open multiple sessions simultaneously, or that they should try testing with combinations of human and robot players. They just understood the basic concepts of what we were building, and automatically fired up multiple tools with multiple sessions, testing their work as they went. (That&#8217;s not to say the code was bug-free &#8211; neither before their own testing, or after! &#8211; but it just reduced my involvement in the process.)</p>
<p>When both AIs said they were done, it was time for <a href="https://www.brentozar.com/archive/2026/07/miscellaneous-thoughts-about-building-stuff-with-ai/">adversarial testing</a>. I pointed Copilot &amp; Claude at Codex&#8217;s sp_TexasHoldEm, and pointed Copilot &amp; Codex at Claude&#8217;s version. That brought up a whole fiesta of new bug reports.</p>
<h3>The Security Issues Begin to Surface</h3>
<p>To its credit, Github Copilot (which I usually snicker at) actually caught the snooping problem, and in its code notes, highlighted Codex&#8217;s decision to purposely leave the hand data in globally visible global temp tables:</p>
<blockquote><p>Copilot: The procedure advertises hole-card privacy for spectators, but hole cards are stored in a global temp table. Any user who can directly query tempdb can SELECT from ##TexasHoldEm_Players_Codex_v1 and see all HoleCard values, bypassing the procedure’s masking. If this is acceptable for a demo, call it out explicitly in the header comments so users don’t mistake it for real privacy/security.</p></blockquote>
<p>I love that! Amusingly, Codex &#8220;solved it&#8221; by adding a certificate &#8211; but checked the certificate creation code, including its password, into the Github repo. &lt;sigh&gt; Secure online gambling, this is not:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">IF CERT_ID(N'sp_TexasHoldEm_CardProtection_Codex') IS NULL
BEGIN
    CREATE CERTIFICATE sp_TexasHoldEm_CardProtection_Codex
        ENCRYPTION BY PASSWORD = 'QueryBucks-Codex-demo-certificate-2026!'
        WITH SUBJECT = 'Encrypt transient sp_TexasHoldEm hole cards',
             EXPIRY_DATE = '20991231';
END;
GO

DENY CONTROL ON CERTIFICATE::sp_TexasHoldEm_CardProtection_Codex TO public;
GO</pre><p></p>
<p>Whatever. On the other hand (GET IT?! HAND!), Claude&#8217;s version didn&#8217;t even mention anything about privacy, so as a result, neither Copilot nor Codex raised (GET IT?!! RAISED!!!) a red flag about the ability for anyone to query temp objects and see someone else&#8217;s cards.</p>
<p>Even worse, none of the code authoring or reviews picked up the possibility that someone might <em>update the global temp tables</em>, thereby changing hands, hahaha. From the get-go, I wanted to publish this stored proc and let people run it in Azure SQL DB, playing against each other, and I knew my more, uh, &#8220;enterprising&#8221; readers would be doing that kind of thing. I let that slide initially though &#8211; we&#8217;ll come back to that.</p>
<p>I didn&#8217;t ask Claude to fix the security holes in his version because I think it&#8217;s a neat artifact to leave around if you want to test asking your own LLMs for comparisons and pros/cons between the two versions. It&#8217;s neat to see how various LLMs observe the security concern. (Plus, I was out on vacation, so I was putting very minimal effort into this &#8211; I was mostly just letting the two LLMs battle it out with coding &amp; testing.)</p>
<p>Reading the source code is wonderfully enlightening, too. Both platforms thought about things like trying to avoid transactions that might be set up by a hostile player: they could conceivably start a transaction, call the stored proc to get their next card dealt, and then abort/retry the transaction if they didn&#8217;t like their card! Wild.</p>
<hr />
<h3>Comparing the First-Round Solutions</h3>
<p>I asked both LLMs to compare the pros &amp; cons of their solutions. Both were good, but I&#8217;m going to show a screenshot of Codex&#8217;s review first because it has a spiffy little grid:</p>
<p><img data-recalc-dims="1" style=' display: block; margin-right: auto; margin-left: auto;'  loading="lazy" decoding="async" class="aligncenter size-large wp-image-359238" src="https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/Codex-comparison.jpg?resize=1000%2C813&#038;ssl=1" alt="Comparing sp_TexasHoldEm versions" width="1000" height="813" srcset="https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/Codex-comparison.jpg?resize=1000%2C813&amp;ssl=1 1000w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/Codex-comparison.jpg?resize=400%2C325&amp;ssl=1 400w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/Codex-comparison.jpg?resize=768%2C624&amp;ssl=1 768w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/Codex-comparison.jpg?resize=1536%2C1249&amp;ssl=1 1536w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/Codex-comparison.jpg?resize=600%2C488&amp;ssl=1 600w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/Codex-comparison.jpg?w=1626&amp;ssl=1 1626w" sizes="auto, (max-width: 1000px) 100vw, 1000px" /></p>
<p>In my experience, both of those LLMs tend to be generously kind when comparing &amp; contrasting their own solutions against a different LLM vendor&#8217;s solutions.</p>
<p>After a few rounds of code review and issue-fixing, all done by the robots, I introduced the robots to the next challenge: building a version I could run on a public server, with adversarial users. They each tried their best to harden their solutions, and they lobbed tons of pull request notes at each other&#8217;s versions. If you wanna get a laugh about that, <a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/pull/17">the code review notes on pull request 17</a> (code by Codex, reviews by Claude &amp; Copilot) were particularly awful.</p>
<p>The end results, in case you want to do your own code review (I certainly didn&#8217;t &#8211; vacation, remember):</p>
<ul>
<li><a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/blob/master/T-SQL/sp_TexasHoldEm_Claude/sp_TexasHoldEm.sql">Claude&#8217;s first round version</a> and <a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/blob/master/T-SQL/sp_TexasHoldEm_Claude/sp_TexasHoldEm_Public.sql">its hardened version</a></li>
<li><a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/blob/master/T-SQL/sp_TexasHoldEm_Codex/sp_TexasHoldEm.sql">Codex&#8217;s first round version</a> and <a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/blob/master/T-SQL/sp_TexasHoldEm_Codex/sp_TexasHoldEm_Public/sp_TexasHoldEm.sql">its hardened version</a></li>
</ul>
<p>I liked the playability of Claude&#8217;s version much better: it felt much more interactive, using waits to hold you back while other people were doing their thing, and your session was only freed up when it was time for you to take an action. It was much more like a real poker game. So I picked out a few things I loved from Codex&#8217;s version (like the smarter player logic and the ability to go all-in easily), and told Claude to integrate those features, and the human testing began.</p>
<p>While I was testing, I casually told Claude Code to design a web page to let bystanders view the results, and then had Codex build it. That&#8217;s what you see in the web page above, and if you&#8217;re reading on RSS, you&#8217;ll need to go to the blog post to see the live updates of whoever is playing poker at the moment. (No serious reason as to why I picked Codex &#8211; I just had more leftover credits on that one because ChatGPT&#8217;s been doing weekly resets like crazy, giving you all kinds of free coding credits.)</p>
<p>You can see the <a href="https://github.com/BrentOzarULTD/BrentOzar.com-Demos/tree/master/T-SQL/sp_TexasHoldEm_Claude/web">source code for the web page over in the Github repo too</a>. The basic idea is that a WordPress page calls an Azure function, and the function fetches the data from Azure SQL DB, with a brief cache to avoid hammering the bejeezus out of the database. The Azure SQL DB is open to the world on port 1433, but WordPress doesn&#8217;t have MSSQL drivers in it, so having the WordPress page hit a REST API in Azure Functions was the easiest way to do it.</p>
<h3>I Have Mixed Feelings About All This.</h3>
<p><a href="https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/pizza-hut-china.jpg?ssl=1"><img data-recalc-dims="1" style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  loading="lazy" decoding="async" class="alignright size-medium wp-image-359264" src="https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/pizza-hut-china.jpg?resize=388%2C400&#038;ssl=1" alt="Spicy Ramen Pizza" width="388" height="400" srcset="https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/pizza-hut-china.jpg?resize=388%2C400&amp;ssl=1 388w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/pizza-hut-china.jpg?resize=1000%2C1032&amp;ssl=1 1000w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/pizza-hut-china.jpg?resize=768%2C792&amp;ssl=1 768w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/pizza-hut-china.jpg?resize=600%2C619&amp;ssl=1 600w, https://i0.wp.com/www.brentozar.com/wp-content/uploads/2026/08/pizza-hut-china.jpg?w=1260&amp;ssl=1 1260w" sizes="auto, (max-width: 388px) 100vw, 388px" /></a>When Brad Schulz crafted <a href="https://bradsruminations.blogspot.com/2010/04/playing-for-high-stakes.html">his poker-playing-T-SQL</a>, it was impressive partially because of the work that it required. This above stuff? I&#8217;mma be honest, dear reader, I have almost no work involved in it at all. I haven&#8217;t even read all of the source code, nor do I intend to. All I did was hand AI vendors my credit card and write a brief prompt. You <em>shouldn&#8217;t</em> respect the above stuff the way you respect Brad&#8217;s hand-done work.</p>
<p>But &#8230; it sure is mighty fun to play with.</p>
<p>I don&#8217;t know how long this golden age of AI is going to last. Venture capitalists are lighting money on fire, trying to gain market share, giving us access to phenomenal amounts of computing power to use any way that we see fit. Most of the time, I&#8217;m using it responsibly trying to solve client problems and improve my training material, but every now and then, I play around like this. Do I feel guilty about this? Absolutely. Do I deserve your kudos for building it? Not in the least. I&#8217;m a monkey banging on an extremely smart typewriter.</p>
<p>And I am absolutely, positively sure that right now, as we read this together, someone is using AI to build an app to call this stored procedure, play poker on their behalf, automatically make all the right wagers, and dominate the leaderboard.</p>
<p>Life, uh, finds a way.</p>
<p>While AI was doing all this, I was out in China, enjoying the local delicacies. Did you know that in China, Pizza Hut sells a spicy ramen pizza? It&#8217;s a thin crust with fried chicken and spicy noodles on top &#8211; like, so spicy that the Chinese natives I was with all started coughing, and refused to eat more than a single bite. (Me too.) It was, uh &#8230; something.</p>
<p><em>Note: all of the code in this post was written by AI, using Claude Code, ChatGPT Codex, and Github Copilot. The words were written by me.</em></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.brentozar.com/archive/2026/08/sp_texasholdem-multi-player-poker-in-t-sql/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">359231</post-id>	</item>
		<item>
		<title>Database Animations: The Difference Between Row Compression and Page Compression</title>
		<link>https://www.brentozar.com/archive/2026/08/database-animations-the-difference-between-row-compression-and-page-compression/</link>
					<comments>https://www.brentozar.com/archive/2026/08/database-animations-the-difference-between-row-compression-and-page-compression/#comments</comments>
		
		<dc:creator><![CDATA[Brent Ozar]]></dc:creator>
		<pubDate>Wed, 19 Aug 2026 13:15:51 +0000</pubDate>
				<category><![CDATA[Database Animations]]></category>
		<category><![CDATA[Indexing]]></category>
		<guid isPermaLink="false">https://www.brentozar.com/?p=359183</guid>

					<description><![CDATA[What&#8217;s the difference between SQL Server&#8217;s row compression and page compression, and when does each one make sense? Row compression turns every fixed-length datatype into a variable-length datatype, using as little space as possible to store it Page compression does that, AND adds a dictionary of repeated data on the page, getting more compression at [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>What&#8217;s the difference between SQL Server&#8217;s row compression and page compression, and when does each one make sense?</p>
<ul>
<li>Row compression turns every fixed-length datatype into a variable-length datatype, using as little space as possible to store it</li>
<li>Page compression does that, AND adds a dictionary of repeated data on the page, getting more compression at the cost of more CPU</li>
</ul>
<p>To see it in more detail, let&#8217;s fire up one of <a href="https://www.brentozar.com/archive/category/database-animations/">my Database Animations</a>.</p>
<h3>How Row Compression Works</h3>
<p>Let&#8217;s start by looking at the clustered index of the Users table from <a href="https://www.brentozar.com/archive/2015/10/how-to-download-the-stack-overflow-database-via-bittorrent/">the Stack Overflow database</a> you know and love so well. That table some fixed-length columns like:</p>
<ul>
<li>Id: INT, 4 bytes</li>
<li>Reputation : INT, 4 bytes</li>
<li>Age: INT, 4 bytes</li>
<li>CreationDate: DATETIME, 8 bytes</li>
</ul>
<p>However, a lot of the rows don&#8217;t need the full 4 or 8 bytes in order to store their data. Most peoples&#8217; reputations (especially yours) is a very small number, so it doesn&#8217;t need all 4 bytes of storage. Age used to be populated, but these days it&#8217;s null for security purposes, so nothing goes in there at all. If we enable row compression (by rebuilding the clustered index with row compression turned on), let&#8217;s see how storage is impacted:</p>
<p><a href="https://www.brentozar.com/archive/2026/08/database-animations-the-difference-between-row-compression-and-page-compression/"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/www.brentozar.com/wp-content/uploads/animations/row-compression-email.gif?w=600&#038;ssl=1" alt="Row Compression (animation)"  style="max-width:100%;height:auto;" /></a><br /><a href="https://www.brentozar.com/archive/2026/08/database-animations-the-difference-between-row-compression-and-page-compression/">&#9654; Watch the animated version of Row Compression</a></p>
<p>With row compression, SQL Server automatically uses the smallest amount of space possible to store the relevant data. The bigger of a fixed-length datatype your datamodel uses, and the smaller your data actually is, the bigger your compression savings will be. I kinda think of row compression as undoing the technical debt cost of people who said, &#8220;HEY LET&#8217;S USE BIG DATATYPES JUST IN CASE!&#8221;</p>
<p>For the most part, row compression&#8217;s savings only impacts fixed-length datatypes. If you&#8217;re using VARCHAR(4000) in order to store postal code, you&#8217;re not going to see any savings here, because SQL Server already just stores the length of the data, not all 4,000 bytes by default. Let&#8217;s be honest &#8211; this is where those big-data-datatypes people really went wild and crazy, and their overzealousness at picking big numbers never really hurt you in terms of storage taken up anyway.</p>
<p>There&#8217;s one edge case where row compression savings actually helps variable-length datatypes: when you store VARCHAR values in NVARCHAR datatypes. For more on that edge case, check out <a href="https://www.brentozar.com/archive/2025/10/which-should-you-use-varchar-or-nvarchar/">Which Should You Use: VARCHAR or NVARCHAR?</a> I hate to give away spoilers, but I feel like I need to here because most experienced architects make the wrong choice: you should be using NVARCHAR, even if you&#8217;re storing VARCHAR data, and enabling row compression.</p>
<h3>How Page Compression Works</h3>
<p>Row compression works at the row level. It&#8217;s zoomed in to just what&#8217;s happening on a single row. At that level, you can&#8217;t really identify duplication of data because we rarely store the same data over and over again in different columns.</p>
<p>Page compression works at the <em>page</em> level, though, and it <em>does</em> identify duplicate data stored over and over again on the same page. It builds a dictionary on that page, storing redundant data just once.</p>
<p>Continuing with our Users clustered index example, let&#8217;s think about the Location column stored on that page. (To keep things simple for the diagram, I&#8217;m only showing the Location column&#8217;s contents, but of course <em>all</em> of the columns are stored on these 8KB pages.) Odds are, we&#8217;re going to have some people with the same (or at least similar) locations on any given 8KB page, and that&#8217;s where de-duplicating data starts to save space:</p>
<p><a href="https://www.brentozar.com/archive/2026/08/database-animations-the-difference-between-row-compression-and-page-compression/"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/www.brentozar.com/wp-content/uploads/animations/page-compression-email.gif?w=600&#038;ssl=1" alt="Page Compression (animation)"  style="max-width:100%;height:auto;" /></a><br /><a href="https://www.brentozar.com/archive/2026/08/database-animations-the-difference-between-row-compression-and-page-compression/">&#9654; Watch the animated version of Page Compression</a></p>
<p>This technique saves more space, <em>even on variable-length columns</em>, by identifying those duplicates on each page, and only storing them once. This does come with the overhead of more CPU consumed to analyze each row on the page <em>in relation to the other rows</em>, identifying those duplicates, building the dictionary, and updating the stored values.</p>
<p>This is especially powerful on nonclustered indexes. Eagle-eyed readers will look at the above animation and say, &#8220;Wait, on the clustered index, it&#8217;s fairly unlikely that I have several rows with the same location. The clustered index is sorted by Id, not by Location, and it&#8217;s extremely unlikely that a bunch of people from the same location are gonna sign up at the same time, in order.&#8221; Those are my favorite kinds of readers because they put their hands up in class, and I get to say &#8220;Good question!&#8221; and I get genuinely excited, because they&#8217;re absorbing the information. I know, you didn&#8217;t catch that, and that&#8217;s okay &#8211; you&#8217;re my <em>second</em> favorite kind of reader. Anyhoo, on nonclustered indexes, especially on an index like Location, we&#8217;ll see a <em>ton</em> of duplicate values stored in order on the same 8KB page, and page compression savings is huge here.</p>
<p>There are a couple of gotchas with page-level compression. First off &#8211; and I hate to beat this dead horse &#8211; but it only works at the 8KB page level. If <a href="https://www.brentozar.com/archive/2026/08/database-animations-why-big-columns-may-not-affect-logical-reads/">you store your large strings off-row</a>, page compression doesn&#8217;t work there. This especially hits big string data like JSON and XML &#8211; very wordy data with a lot of duplicate strings, exactly where we would <em>want</em> compression, but page compression just doesn&#8217;t do anything about that.</p>
<p>Second, the dictionary is still only stored at the page level. In a perfect world, we&#8217;d have a dictionary across an entire table&#8217;s contents, at the column level, so that we only had to store the term &#8220;Helsinki&#8221; once, and refer to it everywhere with the same dictionary reference number, no matter which 8KB page the person&#8217;s location was stored on. That doesn&#8217;t happen, though, because page compression works at the page level &#8211; not at the column level or the table level.</p>
<p>Finally, your worst case scenario for page compression would be data that is frequently updated in-place (on the same 8KB page), that isn&#8217;t compressible. SQL Server will waste CPU cycles checking to see if any of the data can be compressed, and coming up empty each time.</p>
<h3>So, Which Should You Use?</h3>
<p>Use row compression if:</p>
<ul>
<li>You followed <a href="https://www.brentozar.com/archive/2025/10/which-should-you-use-varchar-or-nvarchar/">my advice</a> about storing string data in NVARCHAR columns, and/or</li>
<li>Your architects used big variable-length datatypes to store tiny data</li>
</ul>
<p>Use page compression if:</p>
<ul>
<li>Your 8KB pages have a lot of redundant stuff on-row, on the same 8KB pages (which for nonclustered string indexes, is all of them), and</li>
<li>You&#8217;re bottlenecked on reading data pages from disk (PAGEIOLATCH), not on CPU (SOS_SCHEDULER_YIELD)</li>
</ul>
<p>To enable either form of compression, simply rebuild your indexes:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">ALTER TABLE dbo.Users REBUILD WITH (DATA_COMPRESSION = PAGE);</pre><p></p>
<p><em>Note: I generated the animations in this post with Claude Code, but all of the text &amp; demos are completely written by me.</em></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.brentozar.com/archive/2026/08/database-animations-the-difference-between-row-compression-and-page-compression/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">359183</post-id>	</item>
	</channel>
</rss>