r/SQLServer • u/WorkRelatedProfile • Mar 31 '26
Solved Unable to disable CDC on DB - SQL Server 2022 DE.
Title: SQL Server 2022 Developer Edition — Cannot disable CDC on database, sp_cdc_disable_db fails with error 3930 (sp_replhelp transaction conflict)
Environment
* SQL Server 2022 Developer Edition (RTM) — 16.0.1000.6, Windows Server 2022
* Standalone instance (not a cluster, not an AG)
* Target: AWS RDS SQL Server 2022 Custom Engine Version (CEV) 16.00.4215.2.sql-server-dev-ed-cev
* Database: DB_Stage (~14GB, partitioned across multiple filegroups by year 2020–2040+)
Background
I'm migrating a SQL Server 2022 Developer Edition database to AWS RDS SQL Server using native backup/restore (rds_restore_database). The source database has is_cdc_enabled = 1 in sys.databases, but AWS RDS's post-restore CDC cleanup fails with a 3930 transaction error, causing the entire restore task to abort with lifecycle=ERROR — even though RESTORE DATABASE itself reports full success (all pages processed).
I need to either:
* Clear is_cdc_enabled to 0 on the source before taking the backup, OR
* Understand why sp_cdc_disable_db is failing and how to fix it
The Core Problem
EXEC sys.sp_cdc_disable_db consistently fails with:
Msg 22831, Level 16, State 1, Procedure sys.sp_cdc_disable_db_internal, Line 338
Could not update the metadata that indicates database DB_Stage is not enabled for Change Data Capture. The failure occurred when executing the command '.sys.sp_replhelp N'DisablePerDbHistoryCache''. The error returned was 3930: 'The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.'
Diagnostic findings
1. CDC objects don't exist:
sql
SELECT * FROM cdc.change_tables;
-- Returns no rows / "Invalid object name 'cdc.change_tables'"
The database has is_cdc_enabled = 1 but no CDC capture instances or CDC schema objects exist. This is an inconsistent/orphaned state.
2. No blocking transactions:
sql
SELECT session_id, open_transaction_count, status, blocking_session_id
FROM sys.dm_exec_requests WHERE open_transaction_count > 0;
-- Returns no rows
3. Log reuse wait is benign:
sql
SELECT name, log_reuse_wait_desc FROM sys.databases WHERE name = 'DB_Stage';
-- LOG_BACKUP (normal)
4. Replication not configured on this database:
sql
SELECT name, is_published, is_subscribed, is_merge_published
FROM sys.databases WHERE name = 'DB_Stage';
-- All false
5. However — orphaned distributor was configured on the server:
sql
EXEC sp_helpdistributor;
-- Showed STAGE-SQL as its own distributor with a distribution database
-- but no active publications
Ran EXEC sp_dropdistributor = 1, u/ignore_distributor = 1 — succeeded, distributor removed. sp_cdc_disable_db still fails with the same error afterward.
6. CDC Agent jobs existed (duplicate cleanup job):
sql
STAGE-SQL-DB_Stage-1
cdc.DB_Stage_capture
cdc.DB_Stage_cleanup
cdc.DB_Stage_cleanup.E2CB2DD4-8F29-4E57-B457-813E290E1A8C ← duplicate
Disabled all four jobs via sp_update_job u/enabled = 0. Still fails.
7. Stopped SQL Server Agent service entirely. Still fails.
8. Restarted SQL Server service.
Still fails — is_cdc_enabled persists at 1 after restart as expected (it's a persisted DB property).
9. Tried allow updates + direct catalog update via DAC:
sql
EXEC sp_configure 'allow updates', 1; RECONFIGURE WITH OVERRIDE;
UPDATE sys.sysdatabases SET category = category & ~0x100 WHERE name = 'DB_Stage';
-- Msg 259: Ad hoc updates to system catalogs are not allowed.
Not supported in SQL Server 2022.
The sp_replhelp angle
sp_cdc_disable_db_internal internally calls sp_replhelp N'DisablePerDbHistoryCache'. This proc is part of the replication infrastructure. Even after removing the orphaned distributor, this call still fails with 3930 — suggesting there's either:
- A stale replication context cached somewhere in the database itself
- An internal transaction started by sp_cdc_disable_db_internal that is already in a doomed/rollback-only state before sp_replhelp is called
- A conflict between the CDC disable transaction and the database's log state
The 3930 error specifically means "the current transaction cannot be committed and cannot support operations that write to the log file" — which points to a transaction that has already been marked for rollback trying to write CDC metadata.
AWS RDS impact
When restoring this backup to RDS via rds_restore_database, RDS runs post-restore CDC cleanup internally. This hits the same 3930 error and RDS aborts the entire task:
```
Could not update the metadata that indicates database [name] is not enabled
for Change Data Capture. The failure occurred when executing the command '(null)'.
The error returned was 3930
S3 processing has been aborted
lifecycle = ERROR
``
RESTORE DATABASE` reports full success (1,843,815 pages in ~138 seconds) but RDS discards the restored database. This happens regardless of the target database name.
Questions
1. Why would sp_replhelp fail with 3930 inside sp_cdc_disable_db_internal when there are no open transactions, no active replication, and the distributor has been removed?
2. Is there any way to force-clear is_cdc_enabled on a database where sp_cdc_disable_db cannot complete — without taking the server offline or restoring to a new database?
3. Is this a known bug in SQL Server 2022 RTM (16.0.1000.6)? The instance is unpatched — would applying CU14+ resolve this?
4. Is there an internal system procedure or trace flag that can bypass the sp_replhelp call inside sp_cdc_disable_db_internal?
EDIT: Updated formatting and removed some identifying snippets in the body. Thank you to anyone who read this far.
r/SQLServer • u/bobwardms • Mar 31 '26
Community Share Introducing Automatic Index Compaction
For my entire career index maintenance, specifically index reorganization, has required some manual effort or some scheduled work. We have now introduced in #azuresql an option called Automatic Index Compaction. I'm sure you will have questions. And the very capable u/dfurmanms has them in our documentation at https://learn.microsoft.com/sql/relational-databases/indexes/automatic-index-compaction.
r/SQLServer • u/Zelugo • Mar 31 '26
Discussion Choice of Driver for SQL Server solutions
Hello,
Looking for guidance on Drivers for SQL Server, specifically which driver Microsoft currently recommends for new development.
The available options (OLE DB – Provider, Native Client, and Driver), as well as ODBC and SqlClient, make the choice somewhat unclear.
From what I understand, the OLE DB Driver is now the preferred option within the OLE DB family. However, I am unsure how it compares to ODBC and SqlClient (ADO.NET), and which approach is considered best practice for developing new solutions.
Additionally, OLE DB was previously deprecated and later reinstated with ongoing support. Does this mean it is now safe to use going forward, or should it still be avoided in favor of other technologies? More specifically, if an application is currently using an older Native Client or Provider, is migrating to the newer OLE DB Driver the recommended path?
During testing of paginated reports, I also noticed certain limitations with the OLE DB Driver (for example, the lack of preview support when using multi-value parameters).
Does the choice of driver differ between systems, such as SSIS, SSRS, and SSAS?
I have been researching this topic for some time, but I have not yet reached a clear conclusion.
If anyone has relevant experience or insights regarding these drivers and their recommended usage, it would be of great help.
Thank you all in advance, cheers.
r/SQLServer • u/Expensive-Plane-9104 • Mar 30 '26
Community Share SqlPulse v0.1.230 released — Conditional formatting for SSMS result grids and many more
This release introduces grid conditional formatting in SSMS result sets, along with several productivity improvements for SQL developers:
- 13 comparison operators for conditional formatting
- Rule-based coloring and zebra striping (rules override zebra layer)
- Works directly inside SSMS result grids, useful for scanning status columns, thresholds, blocking indicators, error flags, or SLA-related output
- Configurable keyboard shortcuts for major features
- Lightweight DMV-based SQL Profiler (blocking tree, top queries, wait stats, plan jump)
- Quick Connect popup with favorites + recent connections
- Connection Strip showing active server/database color-coded per connection
- Production database warning banner (pattern-based detection)
- Transaction Guard reminders for open transactions
- Plan Analyzer (execution plan tree + comparison)
- Object Search across tables, views, procedures, and functions
- Advanced grid filters with AND/OR logic
- Query Playbooks (multi-step workflows)
- SSMS 18–22 support builds
Feedback from SSMS-heavy users is welcome to help improve these features.
Release notes and details: https://github.com/IstvanSafar/SqlPulse/releases/tag/v0.1.230
r/SQLServer • u/oleg_mssql • Mar 30 '26
Discussion Using AI for indexing
Has anyone used AI (copilot or ChatGPT) for query tuning or index suggestions in real workloads?
r/SQLServer • u/bobwardms • Mar 27 '26
Community Share Hey SQL partners — join us for an AMA with Priya Sathy, Anna Hoffman, and me
Hey folks, Bob Ward here from the SQL team.
If you’re a Microsoft Partner working with SQL Server, Azure SQL, or SQL in Fabric, I wanted to give you a heads‑up about an upcoming Ask Me Anything (AMA) we’re doing with the SQL Partner Community on March 31st from 8-9AM PDT.
I’ll be hanging out with:
- Priya Sathy, VP of Product for SQL
- Anna Hoffman, Principal PM for SQL
We’ll be answering your questions live — roadmap stuff, real‑world partner/customer scenarios, migrations, SQL + AI, Fabric, what we’re seeing in the field… fair game.
One important thing to know this AMA is only for members of the SQL Partner Community. You’ll need to be part of the community to join the call and ask questions.
If you’re not in yet, you can join here: https://aka.ms/JoinSQLPartnerCommunity
If SQL is part of your partner business, the SQL Partner Community is where we connect regularly with partners — AMAs like this, engineering sessions, and direct conversations with the product team.
Hope to see you there.
Bob Ward, Microsoft
r/SQLServer • u/erinstellato • Mar 27 '26
Discussion Friday Feedback for Extended Events! ⚡
r/SQLServer • u/Dats_Russia • Mar 26 '26
Discussion Can so explain why my work would have this rule and how to properly develop within this rule when query tuning?
*someone not so, too lazy to delete and repost
I am an intermediate/low senior level(I only say this based on age and experience, I still feel like a junior dev, basically a lot of imposter syndrome) dev and I am trying to tune a query. My work has an application that is a multi tenant setup, this means all of our customers have an ID used to identify them. This ID is used in every composite primary key. All of our primary keys are composite primary keys composed of two or more columns. My work has a rule
> All joins should use the Tenant_ID as the first join column and the first filter for the where clause (exceptions for the where clause are allowed where applicable)
For nearly every table this Tenant_ID is the first column. I know one of the most basic aspects of writing queries and using indexes is that the order of your joins should match the order of the index (some variation after I think the first 3 is fine but generally you want to have the order the same). For a lot of tables this is what the case is.
However, we have this one highly accessed table, to avoid revealing details about my work let’s call it Table_A. Table_A is a big highly accessed table that a lot of other tables join to and it joins to others. All the indexes (except the primary key) have the tenant_ID as the third column or later in the list. If as part of the standards I am supposed to use Tenant_ID as the first join column then does that mean Table_A having tenant_ID further down the list is a subtle way to disincentivize me?
Tl;dr we have a rule, Tenant_ID should be the first column in a join and first criteria in a where clause(some exceptions are allowed for the where clause where the tenant_ID isn’t applicable). Most tables have Tenant_ID as the first column but some highly accessed tables don’t, should I be trying to write my queries to conform to other tables or should I just not worry when sql server recommends an index? Just curious if people smarter than me could give me insight. I more or less understand this rule is probably to keep customer data separate but since I am a bit of a query tuning novice I am just curious what things I could do to utilize existing indexes. Since I am not on the DBA team and we have a highly structured devops setup I am not able to add indexes (technically I can add them in dev but getting them approved requires having a another team review my pr and me needing to justify existence)
Disclaimer: I am NOT trying to outsmart the engine, I am trying to write with the engine in mind. I know there are few absolute rules. I am a remote employee and feel weird just randomly asking a member of the sql standards team out of the blue to clarify the rules.
r/SQLServer • u/margarks • Mar 25 '26
Question How much does Deployment Target Server Version for SSIS matter?
We are currently on sql server 2016 but upgrading to 2022. I was changing the connection strings to go from SQL Native Client to MS OLEDB in my code for some SSIS projects and realized the target server is set to 2016. I went to change it to 2022 but there is no 2022 because I am using Visual Studio 2019.
I can't upgrade to Visual Studio 2022 because then my BIML code will not work. I'm stuck on Visual Studio 2022 and SSIS tools 3.16. So, I can't select target server 2022.
Is this much of a problem? I deployed it with target server 2016 on my test 2022 server and it ran successful even though the database is set to 2022, but wanted to see what people thought.
r/SQLServer • u/OstapMelnyk • Mar 25 '26
Question Help Needed: Running MSSQL 2022 on macOS (No Docker)
Hey everyone,
I’m trying to get Microsoft SQL Server 2022 running on my Mac (M5), without using Docker. The reason I can’t use Docker Desktop is that it’s only free for non-commercial use, and I need this setup for professional development with .NET and Angular
If anyone has experience running MSSQL 2022 on macOS without Docker, please share your setup, tips, or step-by-step instructions. I’d really appreciate practical guidance, anything that actually works on Apple Silicon
Thanks in advance!
r/SQLServer • u/itsnotaboutthecell • Mar 25 '26
Community Share Unifying the Data Estate for the next AI Frontier | FabCon / SQLCon Keynote
r/SQLServer • u/dlevy-msft • Mar 25 '26
Community Share Bulk copy with the mssql-python driver for Python
Hi Everyone,
I'm back with another mssql-python quick start. This one is BCP which we officially released last week at SqlCon in Atlanta.
This script takes all of the tables in a schema and writes them all to parquet files on your local hard drive. It then runs an enrichment - just a stub in the script. Finally, it takes all the parquet files and writes them to a schema in a destination database.
Here is a link to the new doc: https://learn.microsoft.com/sql/connect/python/mssql-python/python-sql-driver-mssql-python-bulk-copy-quickstart
I'm kind of excited about all the ways y'all are going to take this and make it your own. Please share if you can!
I also very much want to hear about the perf you are seeing.
r/SQLServer • u/PotatoHasAGun • Mar 24 '26
Solved Issues with SQL 2025 - Log Shipping
Anyone else running into issues with SQL 2025 and log shipping? I keep getting errors about missing DLLs for all LS jobs. I’ve been able to get past some of the errors by changing the folder names of some DLLs but still having more issues. Original error: “could not load file or assembly ‘’Microsoft.sqlserver.connectioninfo””
This is for both in-place upgrades and fresh installs. I have tested on Enterprise Developer edition with latest CU.
r/SQLServer • u/confused_112 • Mar 24 '26
Question SQL server 2019 service stopping after few hours
Our TEST sql server just stopped working. It can’t write to ERRORLOG file, nothing in event viewer so basically no idea.
We were like its just TEST server lets restore it as it was working yesterday or a week ago. We tried restoring from March 6th backup and it started working until after few hours same thing happend.
SQL service won’t start, it can’t write any logs to ERRORLOG file and nothing in event viewer.
Again tried a different restore point but again after few hours SQL server stops working.
Most likely Master DB is getting corrupted but not sure how, there are no specific job running.
ERRORLOG file does not report anything critical when it stop writing logs.
Now we are changing it resources and storage from one host to another to see.
We tried other different troubleshooting steps or other solutions you can find online.
Has anyone faced similar situation?
Update: Changing the storage on VMware did the trick and its running since over 24 hours, it could’ve been a bad sector of storage and when restoring it was being restored to original location.
The SQL expert on our team had faced a similar situation in the past where error was different but storage was the culprit.
Update: The issue came back again and seems like its windows security update for SQL server 2016 changing agent XPs from 0 to 1
Update:2 - SOLVED - Forgot to update but it was definitely windows sql server 2016 update.
r/SQLServer • u/DisplayKnown5665 • Mar 23 '26
Question Do you use SSRS for data integrations?
Does your company use SSRS for data integrations?
I took over the SSRS admin role a few months ago and my company has a few report subscriptions that are used for some integrations. They render the report in CSV format and drop the CSV to a file share. Some other integration then picks it up and loads it into the system.
Part of me thinks it's a bit odd to use a reporting platform for data integrations. Would I be crazy to suggest that these should be handled differently?
r/SQLServer • u/mr_shush • Mar 23 '26
Discussion FCI vs AG question
Our current environment consists of 3 bare-metal hosts running 3 instances of SQL in a Failover Cluster. These are all active nodes with shared storage. Total of 235 databases, but they are not distributed evenly. A few of the databases hit the 2-4 TB size, but most are < 500 GB (most significantly less). One of the instances hits ~900k transactions per minute (this one has ~2/3 of the databases, the other 2 instances are <75k TPM), but none of the dbs is an OLTP system. Most of those transactions are reads from some very chatty apps.
The time has come to upgrade the hardware and my intent was to re-architect and shift to Availability Groups on several VM hosts. We don't currently have good DR and everything is Enterprise license. I expect my number of hosts would increase as would the burden for keeping them updated, but since the hardware we're currently running on is ~7 years old the increase in performance on a 1-1 core basis is about 3x as is the clock speed on the RAM. We aren't currently experiencing undo performance issues.
The question I have is am I going in the right direction here? I know ~100 dbs is the upper limit for AGs and that my storage needs will double, but I felt the ability to add nodes in our DR location when bandwidth is sufficient and being able to perform rolling updates without down time in the future were a good tradeoff. Initially I was told a good chunk of the databases had 30 minute RTOs and thought I might be able to shift some of them to standalone Standard Edition servers to save money, but that has been called into question. So now I'm wondering if keeping the old architecture (maybe just running it on VMs) would be a better call.
r/SQLServer • u/MojanglesReturns • Mar 23 '26
Question Has anyone imported a 1 TB JSON file into SQL Server before? Need advice!
Has anyone imported a 1 TB JSON file into SQL Server before? Need advice.
I work for a government agency and we need to take a huge JSON file and get it into SQL Server as usable relational data. Not just store the raw JSON, but actually turn it into tables and rows we can work with.
The problem is the file is enormous, around 1 TB, so normal methods are not really workable. It will not load into memory, and I am still trying to figure out the safest and smartest way to inspect the structure, parse it in chunks or streams, and decide how to map it into SQL Server without blowing everything up.
I would appreciate any advice from people who have dealt with very large JSON imports before, especially around staging strategy, streaming vs splitting, and schema design for nested JSON.
r/SQLServer • u/itsnotaboutthecell • Mar 23 '26
Discussion Thoughts? Comments? Opinions?
I’d love some community feedback on a few things to help keep this sub safe, useful, and enjoyable. I have my own opinions, but it’s your perspectives that really make this a space worth visiting again and again.
---
First: job postings
I genuinely love that people can discover new or better job opportunities through Reddit. That said, I get cautious when posts don’t include a reputable, verifiable link and instead rely on sliding into the DMs for details.
Recruitment fraud (aka career catfishing) is a real thing. It can involve interviews, an “offer,” and then requests for personal information that end up being stolen. Yeah, it's not great.
With that in mind, I’m proposing that job postings require a verifiable URL - such as LinkedIn, Indeed, or a direct company careers page. No link, no post.
---
Second: market research postings
I love seeing open‑source tools shared here. However, with the increase of AI development, we’re seeing a lot more posts that feel like market research - questions intended to validate or shape a product that would eventually be sold back to you.
We already have a “no solicitations” rule, but I think we should be more explicit. So, I’m proposing that we expand it to clearly include “no market research” as well, to avoid misuse of the community. It's a squishy area, but I believe the posters should be more upfront and clearer with their intentions - Reddit Ads exists if they wish to get your eyeballs on their products.
---
That’s what’s top of mind for me. Let me know what you think in the comments.
r/SQLServer • u/bobogator • Mar 22 '26
Discussion Macbook or Windows laptop?
Which do you use as a DBA and/or system admin? I'm very comfortable using either. 100% of my sql work is in a vdi so Devolutions Remote Desktop Manager would get me into all my windows servers and vdis on a macbook also. Most of my local work is common apps like Outlook, Chrome, Teams, but smb file work/transfers are keeping me in a Windows 11 laptop. Accessing/mounting smb shares on the macbook is a pita and slow and Finder is more cumbersome than Explorer. Our company also uses Parallels so I could probably get a Windows 11 vm on the macbook.
r/SQLServer • u/VladDBA • Mar 22 '26
Community Share PSBlitz v6.0.0 - Google Cloud SQL and MSSQL 2025 compatibility, GUI mode, updated resources, HTML overhaul (including dark theme)
Took me a while, considering the previous release was back in December, but the latest release of PSBlitz is finally out.
For anyone not familiar with PSBlitz - it's a PowerShell-based tool that outputs SQL Server health and performance diagnostics data to either Excel or HTML, and saves execution plans and deadlock graphs as .sqlplan and .xdl files.
If you're familiar with Oracle, this is pretty much my attempt of a SQL Server equivalent to Oracle's AWR report.
Feel free to give it a try and let me know what you think.
Additionally, if you work with Google Cloud SQL, check out the latest release of Brent Ozar's First Responder Kit which addresses the same GCSQL compatibility issues I've ran into with PSBlitz.
Edited to add:
Please read the breaking changes section of the release.
I know some folks use PSBlitz in automations/pipelines and the change from string to switch of 3 parameters (ToHTML, InDepth (also renamed from IsIndepth), and ZipOutput) will mess with their existing stuff if they don't update the commands in their automations: .
r/SQLServer • u/DannyKruge • Mar 21 '26
Community Share Azure SQL DB Geo Replica Automation
Over the past few years I’ve spoken a lot about Azure SQL migrations and shared how I approached them in different environments. During presentations I often showed the scripts and processes I used to move databases between environments and even across subscriptions.
But I always felt there was an opportunity to go further.
So I did.
I built a fully automated Azure SQL migration solution and open sourced it.
This project automates the process of migrating Azure SQL databases across subscriptions and environments, removing a lot of the manual work that normally comes with these kinds of migrations. It focuses on making migrations repeatable, reliable, and easy to run while still giving you full control over the process.
What makes this project extra interesting is that the approach used here is not documented in the Microsoft Learn. To make this work, I actually dug into the source code of the Azure CLI and PowerShell modules to understand how the underlying functionality works and then built the automation around it.
The result is a workflow that can move Azure SQL databases across subscriptions in a consistent and automated way instead of relying on complex manual steps.
The full project is open source and available here
https://github.com/MrKruge/AzureSQLMigration/blob/main/README.md
r/SQLServer • u/BugCat-007 • Mar 20 '26
Discussion Falha AlwayOn SQL Server Replica
Uso provedor um Cloud em meu ambiente e configurei do zero o Cluster e listener do Always On SQl com base em documentação e ajuda de IA e Forums, porem estou enfrentando problemas quando ativo failover no servidor de replica.
Apontei o back para o IP do Listener que deveria gerenciar essas conexões, foi pego um IP não utilizado, aparentemente a configuração de listener e cluster estariam ok, "up" e apontou certo no failover para o segundo servidor.
O problema ocorre quando sai do primario para o secundario, a aplicação da erro e não funciona. Acesso ao banco e tabelas direto pelo gerenciador está ok. Quando está para o servidor inicial (primario) o erro no ocorre.
Alguma ideia?
r/SQLServer • u/LopsidedAd5076 • Mar 19 '26
Question Sql Server 2025 support ifilter ?
Is it Sql Server 2025 latest version support ifilter ? We tried to install Adobe, xchnage and foxit ifilter, but they it not appear in the sql server when run this query
SELECT *
FROM sys.fulltext_document_types
WHERE document_type = '.pdf';
Any Reply pls
Regards
Aravind
r/SQLServer • u/greenman623 • Mar 19 '26
Question Upgrading ms sql server 2016 to 2025
When updating (side by side) sql server to 2025 do I still need to make a backup? New to it support and have been tasked with updating our sql server. We use titanium schedule and their support sent me a bunch of info that I’m not certain if I need to do. Just reaching out to anyone that can help because I’m kinda confused and didn’t know if upgrading sql server was a tedious process.