Paul White
@SQL_Kiwi
I live in Aotearoa New Zealand and write about SQL Server internals at http://sql.kiwi Microsoft MVP 2011-2022 DBA Stack Exchange Mod 2015-2025
New article: How to Survive a Rollback (when logging) How to ensure log messages are always written to the database, even when a containing transaction rolls back. sql.kiwi/2025/04/surviv…
I don't really understand why anyone is excited about nested CTEs, but if you want to try it on SQL 2025 CTP2 box, enable TF 15320 (session or global). Currently only documented for 'Fabric' whatever that is docs.microsoft.com/en-us/sql/t-sq…
Looks like 'expression indexes' are coming to SQL Server 2025. This is valid syntax on CTP 2 when trace flag 17152 is enabled: CREATE INDEX ix ON MyTable (n * 2); It creates a computed column for you, named e.g. $expression_index_B18729F8A924473FA0DF2CB95D9B2E01.
Interesting undocumented USE HINTs in SQL Server 2025 CTP 2: * DISABLE_PERFORMANCE_SORT_FOR_DML sets DMLRequestSort to false like TF 8795 * DISABLE_OPTIONAL_PARAMETER_OPTIMIZATION * PARALLEL_DML_FOR_VECTOR_INDEX_BUILD * DISABLE_SCALABLE_SUBTREE
TRUNCATE TABLE WITH PARTITIONS causes data corruption with non-aligned partitions feedback.azure.com/d365community/…
This is a really funny SQL Server bug dbfiddle.uk/iUmhLPln DECLARE @T table (i smallint NOT NULL PRIMARY KEY); INSERT @T (i) VALUES (256); SELECT TRY_CONVERT(tinyint, T.i) FROM @T AS T; SET STATISTICS XML ON; -- Oops! SELECT T.i FROM @T AS T WHERE TRY_CONVERT(tinyint,…
New article: Recording Debugging Information Inside a SQL Server Function Call We cannot use PRINT or RAISERROR statements within a T-SQL function body for debugging purposes. This article presents a workaround using session context. sql.kiwi/2025/04/debug-…
FYI my rates for US residents have increased by 25% from today
New article: Accessing a SQL Server Table Variable in a Different Scope Two ways to access a SQL Server table variable outside its declaration scope. sql.kiwi/2025/04/access…
Since 2008, XACT_STATE includes system transactions, so it works correctly in triggers. But: -- XACT_STATE = 0 PRINT 'XACT_STATE = ' + CONVERT(varchar(11), XACT_STATE()); -- XACT_STATE = 1 PRINT CONCAT('XACT_STATE = ', XACT_STATE()); 😲
You can't use PRINT or RAISERROR in a SQL Server function to emit debugging data. A workaround: Call sp_set_session_context to save info inside the function. Read the data using SESSION_CONTEXT after the function call.
New article: Avoid optional_spid Plan Cache Issues when Sharing Temp Tables How to avoid unnecessary stored procedure compilation and plan cache pollution when using shared SQL Server temporary tables. sql.kiwi/2025/03/avoid-…
New article: Sharing Data Between Procedures using a Cursor Contrary to the product documentation, SQL Server cursor variables can be used to share data between stored procedures in the input or output direction (but not both). sql.kiwi/2025/03/sharin…
Follow-up article showing how to use this technique with updates: Updating in Batches using an API Cursor sql.kiwi/2025/03/batch-…
New article: What Was the TOP PERCENT Bug and How Was It Fixed? sql.kiwi/2025/03/top-pe…
United States الاتجاهات
- 1. Good Thursday 25.8K posts
- 2. Happy Friday Eve N/A
- 3. #thursdayvibes 1,563 posts
- 4. #DMDCHARITY2025 1.61M posts
- 5. Merry Christmas 67.7K posts
- 6. Toyota 26.2K posts
- 7. Halle Berry 3,712 posts
- 8. Steve Cropper 7,993 posts
- 9. Earl Campbell 2,226 posts
- 10. Metroid Prime 4 15.9K posts
- 11. #JUPITER 242K posts
- 12. #ALLOCATION 722K posts
- 13. #TusksUp N/A
- 14. The BIGGЕST 1.03M posts
- 15. Market Focus 4,696 posts
- 16. Milo 13K posts
- 17. Mike Lindell 24.6K posts
- 18. seokjin 169K posts
- 19. Jamal Murray 8,376 posts
- 20. #TheChallenge41 2,281 posts
Something went wrong.
Something went wrong.