How to truncate logs with log shipping enabled
Hello, I have a SQL Server 2016 server with multiple SQL Server instances acting as primary server in a log shipping configuration. I have configured log shipping as per…


listener issue
Failed to retrieve data for this request.(Microsoft.SQLServer.Management.sdk.sfc)
CPU HyperThreading Core evaluation
Hello, We are currently trying to evaluate our current On-Prem Sql Server CPU HyperThreading Core evaluation for license cost purpose. Our current Sql Servers are from 2014 to 2019 sql version. Is it any prefer way I can estimate that Sql server has the…

removestaledbentries: cleanup of stale db entries skipped beacuse master db is not memory optimized
removestaledbentries: cleanup of stale db entries skipped beacuse master db is not memory optimized The above message is occurring frequently and persistently. How can I resolve this issue?" sql-server 2022
How to replace all illegal XML chars when casting to XML
Hi, What is the proper way to cast varchar value to XML which may contain illegal XML characters? Can you please explain with CDATA or should it be complex replace command? Thanks in advance.

Azure SQL - can't drop system versioned tables
Hello. I'm can't drop system versioned tables in master db in Azure SQL I have a docs - https://learn.microsoft.com/en-us/sql/relational-databases/tables/stopping-system-versioning-on-a-system-versioned-temporal-table?view=azuresqldb-current but…

No drag and drop on SQL Server Management Studio on external display after installing update KB5051987
After installing the following update last Tuesday, I've lost the drag and drop feature in SQL Server Management Studio: 2025-02 Cumulative Update for Windows 11 Version 24H2 for x64-based Systems (KB5051987) The mouse drag'n'drop is completely disabled…
Install error for packages-microsoft-prod.deb
I am following the guide here:…
Does the order of JOIN criteria's matter?
I'm currently trying to figure out if the order or JOIN criteria's has an influence on performance. Example query: SELECT * FROM table1 AS t1 JOIN table2 AS t2 ON t1.col1 = t2.col2 AND t1.col2 = t2.col2 ... AND t2.coln = t2.coln ```What I…
Upgraded to Windows 11 from Windows 10, Excel Macro that fetches SQL data no longer works
Windows 11 Excel macro connect to sql server 2008 not working. Receiving System Error &H80004005 (-2147467259). Unspecified error. Any ideas on how to get this to work? The Excel macro works from Windows 10.

does sql auditing log the same as sql defender
we have auditing enabled and sql defender both writing to log analytics workspaces, am I doubling my storage cost in doing so?
Recover a Database
Recover a Database that was deleted and the point in time recovery after 7 days has elapsed

Function on Column used in Index - need optimization advice
First, is this the proper forum for MS SQL tsql questions? Why am I seeing only 114 questions? OK, so we have a table ods_DDAHIS which has a TransDate column that is numeric in format YYYYMMDD. There is an index on ods_DDAHIS.Transdate. Then view…
How to add total sum of per Customer under each ID
I have a demo table like this: OrderID CustomerID ProductID OrderAmount OrderDate 1 101 201 100.00 2024-08-01 00:00:00.000 2 101 202 150.00 2024-08-03 00:00:00.000 3 102 201 200.00 2024-08-10 00:00:00.000 4 101 203 120.00 2024-09-15…
Request: Safe Updates Feature in SQL
This feature prevents UPDATE or DELETE queries from executing unless they include a WHERE clause or a LIMIT. It's a safeguard against accidental table-wide modifications and helps maintain data integrity. I believe SQL Server would greatly benefit from a…

High parallelism in Query Store.
Greetings. As you see in the screen shot the bulk of my wait time is going to one wait type. A few fun facts: This is in a reporting type DB with the bulk of activity coming from ETL and Power BI queries, no OLTP type stuff at all. Maxdop on the…
Need tsql to find index usage on views
I have some views that have indexes and i want to get their usage - seeks, scan, lookups - but i cannot find the tsql code.
SQL gaps and island issue
Greetings!!! We're working on migrating data from a legacy application and have a requirement to get all the consecutive SESSION START_DATE & END_DATE. For the SESSION_ID - 8642, SESSION_TYPE - 3256, based on the requirement using sql server query…

How to figure out the total number of doses within a time span given to a client as dose are being added and stopped.?
If the cadence values are different, even if the dates overlap the records must be separate. If an order for the same dose and cadence value (including nulls) starts on the same day or the next day (+or-1 day) the record should continue. outlook of…
A Simple SQL Query
I have the following table:- I want Col 1 and Col 2 where Col2 =1 and the corresponding all the values of Col 1 where Col 1 =2. But this is an example. I can find 1st part (i.e,, Select Col1, Col 2 from Table1 where Col 2 =1). But my problem is how do…
