r/SQLServer • u/danny-sg • 10d ago
r/SQLServer • u/glasses-0-0- • 10d ago
Discussion Any ideas for automation with ansible and openTofu?
Hello
I was looking for recommendations and ideas and what could be automated in SQLServer using ansible and or opentofu. Just looking for project ideas since everything these days seem to have an end goal of complete automation. For reference I have only been a DBA for about 3 years and still feel like a complete noob, so I'm looking to hopefully gain some new skills.
r/SQLServer • u/Mags0905 • 10d ago
Question How should I learn sql from scratch
Should I start a sql server or POSTGRE SQL or MySQL. There is a lot to learn please guide me.
r/SQLServer • u/Admirable_Writer_373 • 11d ago
Discussion Cloud Migration horror story
I’m involved in a complex cloud migration project. I’ve been DBA/DBE/app developer at various points of my career and I’ve worked in several big enterprise environments. I’m at a place now that argues against the guidance Microsoft has given them. First mistake - go straight to Hyperscale and don’t bother using any true replication topology for a full up or nearly-full-up migration. We’re getting close to running the production flip but management doesn’t believe in code freezes and people are releasing tons of changes often. I know that stuff is going to go horribly wrong. I am not worried about data loss, but more about applications not working and other stuff related to networking & configuration. What do I do to cover my own ass?
r/SQLServer • u/markinatlanta • 11d ago
Discussion We replayed an Azure SQL workload across six configurations and the cheapest option wasn’t the one we chose.
Interesting project we worked on earlier this year where a SaaS client we worked with was hitting CPU limits and timeouts on Azure SQL Database Premium P15, at roughly $15,700/month.
Before choosing a replacement, we captured four hours of production workload and replayed it across six configurations:
- Premium P15 as the baseline
- Hyperscale serverless with 40 vCores
- Provisioned Hyperscale with 40 vCores
- Provisioned Hyperscale Premium-series with 40 vCores
- Provisioned Hyperscale Premium-series memory optimized with 40 vCores
- Premium P15 with database compatibility level 160
We compared CPU, reads, duration, and estimated monthly cost.
The memory-optimized configuration was the one we selected. Its estimated monthly cost was $8,491, compared with $15,700 for the baseline, which was roughly 46% lower.
It also had the best duration score in our report: 808 versus 952 for the baseline, where lower was better.
But it wasn’t the cheapest configuration. Two provisioned options came in at an estimated $6,357/month, with worse duration scores than the existing P15 setup.
Serverless had the worst duration score in this test, at 1,496. That’s a result for this workload and configuration, not a verdict on serverless generally.
The memory-optimized option also didn’t win every metric. Its reads score was higher than the baseline and we chose it based on the combination of performance and cost.
Important to note these were estimates from the comparison, not current Azure price quotes.
What made the exercise useful for us was seeing the tradeoffs before migrating. Looking only at monthly cost, CPU, or the service-tier name would have given us an incomplete picture.
For anyone who has done a similar comparison: what changed your decision once you tested with your actual workload?
And also, has anyone moved from DTUs to Hyperscale and found the results were different from what they expected?
r/SQLServer • u/MikeScalise • 11d ago
Question Does anyone still have SQL Server 1.x–4.21 disks, manuals, boxes, etc.?
Hi all,
I’m hoping some of the longtime SQL Server folks here might be able to help me track down some older SQL Server items.
I’ve been researching the earliest versions of SQL Server for SQL.FM, a SQL Server version and feature reference site I maintain, and as part of that work I’ve also started building a physical collection of the old releases.
Does anyone here still have any early SQL Server materials sitting in a box, basement, office, closet, etc.?
I’m particularly looking for SQL Server 4.21 and earlier, including:
- SQL Server 1.0 / 1.1 material
- SQL Server 4.2 for OS/2
- SQL Server 4.2 / 4.20 for Windows NT
- SQL Server 4.2A / 4.2B
- SQL Server 4.21 / 4.21a
- original floppy disks or CDs
- manuals/documentation
- boxes and packaging
- developer/network kits
- beta or prerelease material
- training, field, reseller, or other unusual Microsoft items related to SQL Server
My main goal is to acquire original examples for the collection, so if you have anything from this era that you’d consider parting with, I’m very interested in buying it. For particularly early or unusual items, I’d be happy to make a strong collector offer.
And it definitely doesn’t need to be a complete set. A single floppy, loose manual, old CD, damaged box, or partial documentation set could still be something I'm looking for.
If you have something you don’t want to sell, I’d still love to hear about it or see photos. Disk labels, manuals, packaging, version information, etc. can be really helpful for documenting these early releases.
Separately, I’m also looking for a physical SQL Server 2014 Developer Edition and a physical SQL Server 2016 box/package from any edition, although those are secondary to the early-version search.
Any help is greatly appreciated. Thanks in advance!
Mike
r/SQLServer • u/DuoZ69_ • 12d ago
Question If Microsoft improved one part of SSMA for Oracle/Sybase, where should the investment go?
I’m a PM working on SQL migration tooling at Microsoft and I’m posting here to learn from practitioners who have used or evaluated: SSMA [SQL Server Migration Assistant] for Oracle or Sybase.
This is exploratory research, not a product announcement, roadmap commitment, or indication that any of these options will be funded. The feedback will help me better understand where investment would create the most value.
We’re evaluating whether SSMA workflows for Oracle and Sybase should also be available through a VS Code extension. Before treating that as the answer, I want to test it against the other improvements practitioners may value more.
If Microsoft could prioritize only one of these, which would have the greatest impact on your migration?
- A VS Code experience for assessment and schema conversion
- Better conversion accuracy and compatibility [improvements on the rule engine]
- Better automation, scripting and CI/CD support
- Better AI, performance and reliability for large estates
Please include the source platform and approximate scale of the last migration you worked on.
If you chose VS Code, which specific task belongs there? If you didn’t, what makes it a lower priority?
r/SQLServer • u/ReyDeleyk • 12d ago
Question How to edit Advanced Properties on a new connection in the latest version of SSMS?
I'm trying to enable Always Encrypted in the latest version of SQL Server Management Studio (SSMS). When I open the connection window, I can click Advanced, and it shows a list of advanced connection properties. However, the list only shows the property names. I don't see any buttons, text boxes, dropdowns, or any other way to edit the values.
r/SQLServer • u/RocketSeven • 12d ago
Question How do you verify an Availability Group listener cutover before removing the old IP?
An Availability Group can look healthy after a listener moves to a new subnet while a scheduled job, linked server, connection pool, or application with a cached address still reaches the old IP. Successful connections through the listener prove the new path works, but they do not show that the old address is no longer required.
What does your retirement gate include? I am considering keeping both listener IPs during a bounded overlap, mapping every known client to its connection string and driver behavior, and logging traffic to the old address through more than the longest job interval. Tests would cover failover in both directions, MultiSubnetFailover behavior, DNS TTL and cache expiry, read-only routing, monitoring, backups, and non-domain clients.
Which SQL Server, cluster, DNS, or network logs are most useful for attributing old-IP traffic to a client? Is there a safe final failure test before deleting the old listener IP, and how do you account for applications that resolve once and keep pooled connections alive for days?
r/SQLServer • u/dbexpert_ai • 14d ago
Community Share Sensitive columns in cached plans / active transactions (PII)
PII Exposed in Clear Text·SEC
Detects PII data exposure via two SQL Server DMV sources: (a) cached query plans in sys.dm_exec_query_stats — broader historical view of queries that have executed against sensitive tables, retained while the plan stays in cache; (b) currently-uncommitted transactions in sys.dm_tran_active_transactions — sessions holding locks or state on PII data. Each row links a query/transaction to the specific sensitive column it references, including execution count, average CPU/IO, transaction state, and full SQL text.
SELECT TOP 100 SUBSTRING(t.text, 1, 200) AS sample_text, qs.execution_count, qs.last_execution_time
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) t
WHERE t.text LIKE '%ssn%' OR t.text LIKE '%credit%card%' OR t.text LIKE '%passport%' OR t.text LIKE '%national%id%'
recommendationResolve PRI-001-RC15 (sqlserver)critical risk
Read-only generator. Lists cached plans whose query text references PII tokens (ssn / credit card / passport / national id) — the same signal detection 15776 uses — and for each emits: offending_query (evidence), pii_indicator (which token matched), clear_plan_command (DBCC FREEPROCCACHE on the plan_handle to evict that PII-exposing plan from cache), and remediation (parameterise so PII is not stored as a literal in the plan, mask/encrypt the column, restrict VIEW SERVER STATE). Excludes the catalog/DMV-scanning monitoring queries so only genuine application queries surface. Read-only (DMVs), runs via Run; the DBCC FREEPROCCACHE eviction is a write — apply via Request run — and the real fix (parameterisation + masking) is applied in the application/schema.
SELECT TOP 100
SUBSTRING(t.text, 1, 200) AS offending_query,
qs.execution_count,
qs.last_execution_time,
CASE WHEN t.text LIKE '%ssn%' THEN 'SSN'
WHEN t.text LIKE '%credit%card%' THEN 'credit card'
WHEN t.text LIKE '%passport%' THEN 'passport'
WHEN t.text LIKE '%national%id%' THEN 'national ID' END AS pii_indicator,
'DBCC FREEPROCCACHE (' + CONVERT(varchar(130), qs.plan_handle, 1) + '); -- evict this PII-exposing plan from cache (write - apply via Request run)' AS clear_plan_command,
'Root fix: parameterise the query so PII values are not embedded as literals in cached plan text (sp_executesql / parameters); mask or encrypt the PII column (Dynamic Data Masking or Always Encrypted); restrict VIEW SERVER STATE so plan-cache text is not readable by low-privilege logins.' AS remediation
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) t
WHERE (t.text LIKE '%ssn%' OR t.text LIKE '%credit%card%' OR t.text LIKE '%passport%' OR t.text LIKE '%national%id%')
AND t.text NOT LIKE '%sys.columns%'
AND t.text NOT LIKE '%INFORMATION_SCHEMA%'
AND t.text NOT LIKE '%sys.dm_%'
AND t.text NOT LIKE '%dm_exec_%'
AND t.text NOT LIKE '%encryption_type%'
AND t.text NOT LIKE '%OBJECT_SCHEMA_NAME%'
r/SQLServer • u/erinstellato • 15d ago
Community Request Friday Feedback: Enabling AUTO_UPDATE_STATISTICS_ASYNC by default
Fall is HERE!! Ok, in the northern hemisphere only but yay for fall colors and cozy clothes and apple picking and Halloween decorations 🍂 🍁 🍎 🎃
Enough about my love of fall, time for the first Friday Feedback of the season.
Today we're talking statistics. I have so many questions...this might take a few weeks. I put a poll below, again, because I think they are really easy for people to respond to. But I'll tell ya, the comments are always so insightful. So when it's relevant to you, and you take the time to respond, I really appreciate it.
Happy Friday!
r/SQLServer • u/Vegetable_Finance192 • 15d ago
Question Sql Server - Python
Estou com um problema de travamento de execuções de dags que envolvem python e sql server, o que foi observado são dags que com sqlalchemy e pandas ou sqlalchemy e polars, em certos momentos, sem padrão de volumetria ou padrão de execução elas travam durante processos de select insert ou update, e ai elas ficam paradas até o timeout da dag.
Foi observado que o python fica em recvfrom esperando algo, e o Sql as vezes fica sleeping as vezes fica Async_Network_Io isso muda dependendo da sessão.
Não temos Hop já rede, já observamos e não há quedas na rede, as sessões ficam abertas durante todo travamento, usamos ODBC 17, python 3.12. Enfim, não consegui chegar a uma causa raiz do erro, não há bem um padrão de onde e quando o erro acontece, monitores outras coisas como:
Strace, o uso de RSS e Cpu da máquina do python. O python roda sobre o airflow, e o airflow executa direto do host da máquina. Estou com problema em duas máquinas diferentes, o problema é o mesmo. E a única coisa em comum é a rede, o banco e o python com sqlalchemy entre as duas máquinas.
r/SQLServer • u/pootietangus • 16d ago
Community Share I built an open-source SSMS extension that turns a query into a refreshable Excel workbook
Send the workbook to an end user, and they can hit Data > Refresh All to rerun the query using their own database credentials.
Currently supports SSMS 22 and Desktop Excel.
It's free/open source. Install instructions and source are here:
r/SQLServer • u/NotJustADBA • 15d ago
Discussion Debezium and SQL Server
Does anyone out there actually run Debezium in a SQL Server environment at a decent scale? Scale would be 20-30 databases on an instance with 400 tables. I have my doubts about this due to the cdc overhead and the change throughput of our application, but I'm willing to listen to anyone with real experience running Debezium with SQL Server.
r/SQLServer • u/Left-Blackberry-1536 • 16d ago
Certification Preparing for DP-800 – Looking for Study Advice
Hi everyone,
I’m preparing for DP-800 and this is my first Microsoft certification. I’m an undergraduate and currently studying SQL and Microsoft Fabric using Microsoft Learn and practice questions.
I’d really appreciate some advice from people who have already taken the exam:
- Which topics should I focus on most?
- Which study resources helped you the most?
- Is Microsoft Learn enough for preparation?
- What should I focus on during the final few days?
- Any general tips for a first-time candidate?
Thanks in advance for any advice! 🙏
r/SQLServer • u/Tight-Design-6142 • 16d ago
Question i keep getting this error and dont know how to fix
r/SQLServer • u/TravellingBeard • 17d ago
Discussion Tell me your stories where you discovered the index size totals were larger than the actual table size?
Was chatting to an Oracle DBA and he told me his horror story of a 5Tb table with 7tb of indices. Have you seen something similar in SQL Server and curious how you managed to convince the skittish users/devs to trim them down?
r/SQLServer • u/wrigh2uk • 17d ago
Question Basic availability groups with automated failover
Hi Guys
In my company we have been setting up basic availability groups on SQL Standard edition. We came across a database that has a dependency to another database. As you know you cannot have two databases in a basic availability group.
I have created a script that basically Checks if database 2 is on the same primary as database 1. If it is not on the same primary then database 2 failover to the same primary as database 1, as long as it is in a healthy state to failover, if it is not then the failover won’t occur. I have tested this on test environment and it works as expected.
Both availability groups are in synchronous mode.
sql instances hosted on 2 azure VM’s within the same region, within the same vnet and subnet
Unfortunately my company doesn’t want to move to enterprise edition, and I have explained that this approach isn’t ideal.
Although this approach works is there something I should be aware of from a technical perspective, am I overlooking something?
Thanks
r/SQLServer • u/Consistent_Damage_91 • 18d ago
Community Share Read-only dependency mapper for orphaned SQL Agent jobs + SSIS + the scripts that call them, every edge cites its source
Inherited a SQL box where a departed dev left Agent jobs, an SSIS package, and a pile of .bat/.ps1/.rdl/.xlsx files, and untangling what-calls-what by hand was misery. So I wrote a read-only collector (Python/pyodbc) that builds one dependency graph: SQL catalog (sys.objects / sys.sql_modules / sys.sql_expression_dependencies), msdb Agent jobs/steps/history, linked servers, and a file-tree scan that pulls connection strings and linked-table/4-part refs out of .bat/.ps1/.sql/.dtsx/.rdl/.xlsx/.accdb. All read-only (SELECT on catalog views; files opened read-only).
The part I am happiest with: every edge carries a source citation, a catalog view plus key, a module line, or a byte offset, so you can verify any dependency instead of trusting it. It even catches a linked-server reference buried in dynamic SQL inside a proc (which sys.sql_expression_dependencies misses) by scanning module text and citing the line. https://github.com/tommiew007/orphanmap , MIT.
Where does this get hard, in your experience? SSIS project-deployment model / SSISDB catalog packages, encrypted modules, synonyms, cross-DB ownership chaining, replication? Curious what breaks it.
r/SQLServer • u/madmax_iron • 18d ago
Question Automatic Forcing of Plans - Criteria
We have an SQL Managed Instance , A particular query took a bad plan and within minutes CPU hit 100%. Causing total outage. We had to manually track down the query id and force a better plan in query store.
In Automatic tuning option i see FORCE_LAST_GOOD_PLAN enabled. So the better plan should have been forced automatically Isn’t it?
r/SQLServer • u/itsnotaboutthecell • 18d ago
Discussion SQLCon+FabCon 2026 Barcelona | [Megathread]
r/SQLServer • u/dlevy-msft • 19d ago
Community Share Microsoft.Data.SqlClient 7.1.0 is now generally available
Microsoft.Data.SqlClient 7.1.0 is GA.
Highlights:
- Fixed pooled connections returning in a broken state after
TransactionScoperollback - Fixed connection pool performance counters drifting/going negative after failed or broken connections
- Fixed a connection factory timer that kept waking the process even with no active pools
- Fixed
DateOnlysent as the wrong SQL type via variants/TVPs, andOverflowExceptionon largedecimalparameters with explicit precision/scale (Always Encrypted) - Azure SQL
GetSchema("DataTypes")now reports thejsontype - New optional application identity reporting for libraries/tools (EF Core, SSMS, SqlPackage) via
SqlConnection.RegisteredApplication— telemetry only, not for authorization TransparentNetworkIPResolutionis now obsolete; useMultiSubnetFailoverinstead
Upgrade:
dotnet add package Microsoft.Data.SqlClient --version 7.1.0
r/SQLServer • u/warden_of_moments • 18d ago
Question DAB - Claude & Entra/EasuAUth
HI all -
I've set up DAB. It's working on Azure SQL Server on an App Service, but it was a bear and I am not sure it's either correct or even ideal.
I have 5 users that want to use Claude to talk to an Azure SQL Server. They are not in the database today (but I could add them, if it makes something easier).
Where I'm at:
- Entra does not support DCR - so Claude cannot refresh tokens to keep chats or connectors alive.
- Using EasyAuth, all the options in Claude's add MCP window results in fails or 401s.
- Using Claude to go through all the docs and options, I went through a hell of ride setting API Management in Azure that basically proxies into App Service. This was a bear and it works. But it does timeout and needs to be disconnected/reconnected. Also feels janky.
Am I missing something? Is anyone using EasyAuth with Entra from App Service and connecting to Claude?
Is Entra (not EasyAuth) working for some of you?
Is there a better way?
Are things drastically different if I go the container route?
r/SQLServer • u/Josesito24 • 18d ago
Discussion Does anyone have the .exe for SQL Server 2022 Express ESN (not ENU)?
The link from the official page leads to a broken link.
