r/SQLServer • • Sep 15 '25

Solved What is the best way to connect to an on premise database?

2 Upvotes

I have a chatbot app deployed on railway that needs to retrieve data from an on premise database, I tried cloudflare tunnels but they seem to be focused in MySQL and Postgres, can you help me out?


r/SQLServer • • Sep 14 '25

Solved Puzzling question on moving data from one table to another via table variable

4 Upvotes

I had to do a deployment today (so I was provided the script), where data from a large table in one DB was moved to a dedicated DB. There's a flag on the source table and one of those matches the name of the destination DB.

So the table variable holds the values below:

SELECT DISTNCT TOP (500) KEYCOLUMN FROM SOURCEDB.DBO.SOURCETABLE WHERE PARAM = 'XYZ'

I created a new DB XYZ and the developers gave me a script selecting top X rows from the source table and move to XYZ, then delete from source.

Initially they gave me a small batch of 500 and the moving was taking forever (17 hours for 9 million rows). Changing the batch size to 10000 helped tremendously. There were some identity_insert on and off commands on the destination table as well per batch.

Now my puzzle. When I start the script, it runs decently. Then I notice the rows moved per minute start to slow, creeping up my finish time. The developer said to stop and restart the script, and sure enough, it worked fast again, then slowed over time. I would restart it every 20-30 minutes to get the fast batches processed.

Is the fact that it's a table variable that was used the issue, and they should have just used a proper table (staging or temp) instead? I seem to recall issues with table variables and large numbers of rows but nott sure where the tipping point is.


r/SQLServer • • Sep 13 '25

Discussion Performance Tuning Course

9 Upvotes

I am a SQL Server DBA with 7 years of experience and I’m looking to advance my expertise in performance tuning. Could you recommend a structured Udemy course or video series that covers advanced performance tuning concepts in depth?


r/SQLServer • • Sep 13 '25

Solved Request got approved and is now in production

0 Upvotes

Add an option to give names to connection in Connection Propeties - Developer Community

for those who works with many SQL server instances and are on different IP, having to remember IP of the server is painful, I have notepad file just keep a list of IP and what customer or test env does that IP belong to.


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