Reddit » Microsoft SQL Server
279 FOLLOWERS
This Reddit community exists to hold discussions on Microsoft SQL server administration and T-SQL programming. Find here SQL tutorials & guides, training, MS SQL server certification, SQL server database resources, and everything related.
Reddit » Microsoft SQL Server
16h ago
Is there a way to identify SQL server like is there some unique key stored somewhere.
I have 5 different servers each using same version of SQL server. As of nowbI have to check via "select * from sys.servers" that returns name and a few details but there is no guid or some key in it.
How to get that key that can used from SSMS or through some SQL query in EF core queries.
submitted by /u/SohilAhmed07
[visit reddit] [comments ..read more
Reddit » Microsoft SQL Server
16h ago
Note to mods: if this post is removed again, please let me know why so I can make corrections. Thank you.
Happy Friday! I'm hoping to get some input on two scenarios I've tested and I wanted to hear different opinions. I have two datacenters close together running MS SQL Server AlwaysOn AG in synchronous mode.
Site A has two separate AG instances (one for critical transactions and one for reports) and we rely on SQL Server replication to populate data on the report AG. We are currently working to move away from replication however, that is a story for a different day. Site A also has secondar ..read more
Reddit » Microsoft SQL Server
19h ago
Not to get into too much detail on the company's project, I have 2 sites that require access to the same MS SQL database, neither have completely ideal setups for being the sole host. I recently came across multi-subnet failover cluster, and think it may be a viable option for our scenario. Or at least a start in the right direction.
I have more concern about a connection loss between sites, as opposed to one of the site's instances having an issue/crashing/etc.
If site A loses connection to site B, clients at each site would still be able to connect to their local instance (pic below to ..read more
Reddit » Microsoft SQL Server
23h ago
Hoping someone could shed some light on this. Had a hosting company stand up a new dual Xeon 2630 machine with a couple NVMe drives and 128GB of RAM (I think back to working an entire summer installing stormdoors in the NC heat to pay for 8MB back in 1994 and developing SQL Server databases the same size on a dev machine with 32MB of RAM a few years later). I'm running SQL Server Web Edition 2022 on the metal (Windows Server 2022) and I'm working on the server configuring some stuff with SSMS v 20.1.10. There's nothing really running on the server and everything else is pretty quick. CPU is a ..read more
Reddit » Microsoft SQL Server
23h ago
Hi everyone, sorry for the beginner question.
Say there's a complex-ish view (or a CTE) that uses group-by and other potentially computationally intensive behavior. Let's call it "Heavy_View".
This heavy view exposes a group-by id and a couple columns built with aggregates and other conditions.
Using that view, we have the following query:
select * from some_table t inner join some_other_table c on t.AnotherId = c.AnotherId inner join Heavy_View v on v.GroupById = t.SomeId
Essentially, the same "SomeId" is going to be used for multiple rows.
The question is this: will Heavy_View be calcula ..read more
Reddit » Microsoft SQL Server
1d ago
Let me start with I am in no way shape or form a DBA, however I inherited an SQL server running Thompson-Rueters Practice CS back in November of 2023.
I was hired to replace the MSP that was doing IT for my company and we parted ways back in February of 2024, looks like they were just doing server level backups and no database backups were being performed.
I found a backup solution (Unitreds backup by Kaseya) everything looks good (All servers including the server hosting the SQL Databases are backing up just fine) but our main SQL database isn't backing up i'm getting the following error ..read more
Reddit » Microsoft SQL Server
2d ago
Hello everyone,
Our POS system has a column 'Quantity' which is formatted as INT. The issue is that the POS system writes '1000' to that column for '1' , '2000' for '2' and so forth.
is there a way to write the 'Select' statement so it will show '1' instead of '1000'?
Please advise
Thanks!
submitted by /u/ceantuco
[visit reddit] [comments ..read more
Reddit » Microsoft SQL Server
2d ago
In MS SQL Server and SSMS 2019, I created a second sub-plan ("Subplan_2", on-demand) in the main Maintenance Plan (runs daily at night) to do Transaction Log backups on all the databases. I'd like to be able to copy it (then modify details) into the similar Maintenance Plan on another SQL server instance on another server so that I don't have to create these second sub-plans on every server. Is this possible?
Found MaintenancePlan.Subplan_2 in the Jobs folder on SQL Server Agent in Object Explorer, but other than right-clicking and choosing Script Job As CREATE TO <file>, but looking at ..read more
Reddit » Microsoft SQL Server
2d ago
SELECT *
FROM TableA A
INNER JOIN TableA B
ON A.Column1 = B.Column1
AND A.Column2 = B.Column2
AND A.Column3 = B.Column3
-- Add more conditions for each column as needed
Let's say i both tables have 150 columns, is the only way to write all the AND statements with all the column names?
or is there more simplified/cleaner way? like A.* = B.*?
submitted by /u/RoleLanky8376
[visit reddit] [comments ..read more
Reddit » Microsoft SQL Server
2d ago
As the title says, I wanted to know about replication status and its values. Why are the values different when queried and when viewed in replication monitor?
submitted by /u/ResponsibleComfort63
[visit reddit] [comments ..read more