r/SQLServer • • Sep 11 '25

Solved Column Encryption in Availability Group

3 Upvotes

*edit answered by u/dbrownems https://www.reddit.com/r/SQLServer/comments/1nekfrj/comment/ndpwpqt/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

I just wanted to confirm what I am finding in how column encryption works in an availability group, it seems extremely broken and am having a hard time believing this is how its designed to work.

I've worked with TDE quite a bit and but less so with column encryption.

Is it really the case that without EKM the only way to transparently failover is to copy the service master key from the primary node to all other nodes and then either never rotate the SMK or completely take down the application to rotate it?

This is an existing install I assumed I would be able to change to encryption by a server level certificate that could then be rotated, but encryption by server certificate can't be added to a symmetric key.


r/SQLServer • • Sep 11 '25

Discussion Resources for learning tsql

3 Upvotes

Hello friends looking for resources and our courses that can help me learn how to utilize tsql in Microsoft SQL server.


r/SQLServer • • Sep 11 '25

Discussion SQL DBA for a day (or 2)

Thumbnail reddit.com
4 Upvotes

r/SQLServer • • Sep 10 '25

Discussion Managed instance versus SQL Server VM in Azure - pricing experiences?

9 Upvotes

Hey there, IT Systems Engineer here, we're onboarding a new team to the company that is bringing over a SQL server and some custom apps/scripts they use to ingest data from our vendors via API or file ingestion.

We are moving away from on-prem and don't have the storage for this currently, we're looking at hosting it in Azure which is where we are moving, but with the goal of serverless where possible in mind - this is mainly for both pricing and support overhead reasoning. They will need cross db queries and we may lack the expertise to maintain a workaround.

This leads me to believe our only options will be to simply run a VM with SQL server, or go to a managed instance.

The storage is nothing crazy, just 3TB, and it'll be light usage. Ingestion is manual because when the files are provided by the vendor is not predictable. Outside of that regular use is just manual queries for reporting purposes that would happen in business hours. So we don't really need any kind of scalability, it will probably run on minimum resources and in fact deallocating outside of use is what we would be looking into.

From what I am reading it sounds like a managed instance is going to be pricier than a VM in this case.

We do have a few other apps that require SQL servers we currently host on prem, but our goal is to move those to the cloud as well and ultimately go serverless.

I realize this is a bit of a loaded question and you don't have a picture of our whole environment, just hoping to get some experience in the pros and cons of each approach.

edit: appreciate the help everyone, going to spin up a next-gen MI on the minimum possible specs for our requirements, and maybe a Win 11 VM and give it a whirl. It will likely be much pricier and we don't need cluster/HA, but at this point less overhead and futureproofing is a bonus. We can always fall back to SQL server on a VM if it doesn't work as we hope.


r/SQLServer • • Sep 10 '25

Solved Why can't I install and run SQL Server?

3 Upvotes

I've tried everything, including resetting windows completely twice.

It gives me a sspi issue every time I'm trying to install, and if it installs, as soon as I reboot, it won't run and throw the same error during connection.

I'm in a class and the teacher basically gave up trying to fix it, and I cannot afford another laptop...

Could installing Win 10 help? Is there any guide I could follow?

I'm out of options and I may not be able to follow the class...

Edit: i7-12650H/RTX3050/16/512

Another edit: thanks to all that helped. Turns out going to the "preview" allowed me to click "trust" something and it basically bypassed what was blocking it.


r/SQLServer • • Sep 10 '25

Question to Simplfy dr drill (log shipping)

2 Upvotes

So

I know steps for drill in log shipping but i want to do on sinlge clink /stesps .... I mean i have been doing it either pre-generating scripts or execute sql commands on fly ,use gui to enable-disable jobs ...but know i want to on single command or single click...

How people here carryout ? We cannot use third party tools as they wont fork out money for it


r/SQLServer • • Sep 10 '25

Discussion Azure SQL Firewall

Thumbnail reddit.com
3 Upvotes

r/SQLServer • • Sep 10 '25

Discussion Sql server 2019 installed on hyper-v 2019

Thumbnail reddit.com
1 Upvotes

r/SQLServer • • Sep 09 '25

Solved Increasing connection time-out in SQL Server Management Studio?

4 Upvotes

I'm running a long SQL program in SSMS that is taking > 24 hours to run, and am finding my session times out if left running more than a few hours & I lose my work. (A separate issue: the IT in my company only lets us create temporary tables, not permanent, on the SQL server.)

Clicking on File -> Connect Object Explorer... -> Options>>, I see the default connection time-out setting is only 30 seconds, which seems pretty low.

Can we increase connection time-out setting from 30 seconds to an arbitrarily large value to prevent time-outs?


r/SQLServer • • Sep 07 '25

Discussion Request: ELI5 "SPNs"

11 Upvotes

TL;DR background: 40+ years in IT, 25 in "SQL Server" (10 as SQL dev, 15 as some form of DBA).

Having come up thru the DEV ranks, I was more concerned with the coding/optimization/design/etc side than anything related to the infrastructure side (network, security, hardware, etc). Obviously I've picked up a log of infra knowledge along the way, but there's one thing I've just not been able to wrap my head around -- at least not well enough that I could explain it to someone.

SPNs.

I know how to use SETSPN -L MyDomain\ServiceAcct to get a list of SPNs, and I know how to use

SETSPN -S MSSQL\MyServer.fqdn.com:49001 MyDomain\ServiceAcct SETSPN -S MSSQL\MyServer:49001 MyDomain\ServiceAcct SETSPN -S MSSQL\MyServer.fqdn.com:MyInstance MyDomain\ServiceAcct SETSPN -S MSSQL\MyServer:MyInstance MyDomain\ServiceAcct

As needed to add "missing" entries.

But I don't know -- at an "instinctual" level -- what that actually means, under the hood so to speak. Not like I instinctually know, e.g., what a clustered index is.

So... can anyone with decent network/security knowledge/experience explain this, in plain English? Or point me to a link which accomplishes that?

Thanks in advance!


r/SQLServer • • Sep 07 '25

Solved Help me restore a file in ssms 2022

0 Upvotes

I literally don't know anything about sql, im trying to restore a deleted file but could only find the .bak version. Im trying to restore it through sql ssmss 2022, my libreoffice says it's in c:\users\jdn\AppData\Roaming\LibreOffice\4\user\backup\immortal sin_stigmata.docx.bak. when I try to look for it in ssmss, I go to c:users\jdn but none of the following folders appear.

I made a copy of the bak file and put it in my SD card which is currently connected to the computer, when I click ok it says the media family on device D:\docs\database\immortal sin_stigmata.docx.bak is incorrectly formed. Sql server cannot process this media family. Restore headeronly is terminating abnormally. (Microsoft sql server, error:3241)

What am I supposed to do? And could I get the file back to how it was?


r/SQLServer • • Sep 06 '25

Community Share Learn SQL via typing practice

19 Upvotes

Hi 👋

I'm a software engineer on TypeQuicker.

Most of my previous jobs involved working with some SQL databases and throughout the day, I would frequently need to write (relatively) long and complex queries quickly. Writing queries without having to look up certain uncommon keywords became a cause of friction for me.

In the past I used Anki cards to study various language keywords - but I find this makes it even more engaging and fun!

Helpful for discovery, learning and re-enforcing your SQL skill (or any programming language or tool for that matter)

Hope this helps you! (you can also use custom code - so any queries you write a lot can be practiced here)


r/SQLServer • • Sep 05 '25

Community Share Microsoft listened. GitHub Copikot is coming to SSMS!

27 Upvotes

The most recent comment here has an article explaining why it’s coming. This is exciting news and encouraging that Microsoft is listening and taking action based on customer feedback.

https://developercommunity.visualstudio.com/t/Copilot-in-SSMS-does-not-support-using-G/10907218


r/SQLServer • • Sep 06 '25

Question Azure data factory behaving differently for different sql server

2 Upvotes

So we use azure data factory to fetch the data from Salesforce and dump into our database . We have two database one azure managed sql server and on sql server locally installed on a vm .

So when we dump the data in azure managed sql server the decimals are getting truncated and in vm local db they are getting rounded off

The table and column structure is same on both side

Decimal (18,2 )

For example if values is 124.566 in Salesforce it is coming as

In azure managed sql server- 124.56 And in vm sql server - 124.57

Does anyone know what is causing this inconsistent behavior

Ps : The pipeline of adf is same in both case I cloned the original pipeline and just changed the dumping db that's it


r/SQLServer • • Sep 04 '25

Question In memory heap tables - Is it possible

2 Upvotes

I have a database that is used to import data, compare it to data/ update data in a different database and then the data is deleted. This happens hundreds of times per day. For various reasons, I want to us in-memory tables for the tables used for the import. These tables do not need indexes or primary keys. Can I create in-memory heap tables? I hate to add constraints to these tables, as it could slow down the import process. I'm using MSSQL 2019, but I am porting it to MSSQL 2022 shortly.


r/SQLServer • • Sep 03 '25

Question Sql server utilization increased from 40 % to 60%

6 Upvotes

Hi we have sql server where cpu use to range between 30-40% .But for last 2 days it has been in range 60% and higher .We have checked and its mostly sql server .How to check query which is causing higher cpu utilization. I see many query running there is no pattern to it

I have checked below link https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/performance/troubleshoot-high-cpu-usage-issues

should i run current one or should i execute query which gave historical ones

Also i have doubt , in query which outputs current one does ordering by cpu time desc gives right query ?

Also we have process tracking which trakes and dumps long running query in tables. IN those i am seeing various query with last waittype sos_scheduler_yield , pageIolatchIO_** and some times those related to locks....

So in high cpu case should i target those query which has lastwaitype as sos_scheduler_yield or should I also target pageIolatchIO_** ....

is sos_scheduler_yelid purley related to CPU while pageIOlatch isn`t ? wont query with pageIOLatch wont increase CPU usage ?