769 questions with SQL Server Database Engine tags

Sort by: Updated
1 answer

Why does sys.dm_db_log_space_usage.used_log_space_in_bytes keep increasing with Simple recovery model

I have a simple database with essentially only one active table, though it is a large one. It is for app analytics. A bunch of records are inserted every few seconds. It is searched a few times every day. That is all of its use. Its recovery model is…

SQL Server Database Engine
asked 2026-08-24T09:51:18.3466667+00:00
Hong 1,526 Reputation points
commented 2026-08-26T19:22:54.7366667+00:00
Hong 1,526 Reputation points
1 answer

SQL Server 2022 reports a unique index violation for a non-unique index

Under SQL Server 2022, an intermittent 2601 error occurs during a scheduled data load. SQL Server reports a duplicate key violation on a non-unique index, while referring to the index as a unique index. Another anomaly is that the duplicate key reported…

SQL Server Database Engine
asked 2026-08-25T06:30:09.3433333+00:00
Zalán Kovalcsik 0 Reputation points
commented 2026-08-26T17:42:49.3033333+00:00
Deepesh Dhake 840 Reputation points
1 answer

Failed to install Microsoft Sql server latest version.

I have bought a laptop named ASUS gaming TUF A15. I am trying to install SQL server latest version but failed every time. I contacted ASUS for this. They said this is a third-party application. they are not responsible for this. You need to connect…

SQL Server Database Engine
asked 2026-08-26T12:37:14.7466667+00:00
Ranjan Majumder 0 Reputation points
commented 2026-08-26T16:57:23.2633333+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
1 answer

SQl Services not starting after installing CU3 on SQL 2025

I have installed SQL Pacth on Failover cluster instance for SQL 2025. After installing , SQL Services are not coming up. Error Error message - Script level upgrade for database 'master' failed because upgrade step 'ISServer_upgrade.sql'…

SQL Server Database Engine
asked 2026-08-26T09:31:21.2866667+00:00
Abhishek Gaddam 0 Reputation points
commented 2026-08-26T14:13:39.2066667+00:00
Abhishek Gaddam 0 Reputation points
1 answer

New CE ignores statistics for LIKE predicates on varchar columns with UTF-8 collations — fixed 9% guess (partially fixed in CE 170, `%x%` still affected, no backport)

SUMMARY For varchar columns using any UTF-8 collation (collation name ending in _UTF8), the modern cardinality estimator (CE model 120 to 160) never consults the histogram or string statistics for LIKE predicates. Every "LIKE 'prefix%'" and…

SQL Server Database Engine
asked 2026-08-21T14:07:13.2433333+00:00
Hubert 0 Reputation points
commented 2026-08-25T21:14:05.1566667+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
2 answers

Performance regression von SQL Server 2022 to 2025

We have the following scenario we could reproduce on a single/same Windows Server 2019: Microsoft SQL Server 2025 (RTM-CU8) (KB5104822) - 17.0.4075.5 (X64) - Enterprise Developer Edition (64-bit) on Windows Server 2019 Datacenter 10.0 <X64>…

SQL Server Database Engine
asked 2026-08-25T13:33:21.3933333+00:00
Patrick Simons2 15 Reputation points
commented 2026-08-25T18:05:53.39+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
2 answers

How to prevent auto-update of SQL Server 2025 Engine?

Hi. I am convinced of a JSON bug introduced somewhere between CU4 and CU6. I want to reinstall my instances so I can troubleshoot and then post the bug if it exists. I have repeatedly uninstalled my SQL Server 2025 instances. I have reinstalled 3 RTM…

SQL Server Database Engine
asked 2026-08-20T16:21:39.5566667+00:00
Jeff Foushee 96 Reputation points
edited an answer 2026-08-24T02:54:33.0366667+00:00
Deepesh Dhake 840 Reputation points
3 answers One of the answers was accepted by the question author.

SQL connection failed with SSMS on workgroup when using FQDN

Hello, When I try to connect locally (or remotely) with SSMS on my SQL server with hostname "localhost" or "hostname" it works fine. However, if I try with "hostname.domain.com" it doesn't work I have error 18452 (Login…

SQL Server Database Engine
asked 2026-08-21T20:10:53.5166667+00:00
matteu31 532 Reputation points
accepted 2026-08-22T17:21:01.1066667+00:00
matteu31 532 Reputation points
2 answers

Clarification on SQL Server License Compliance during FCI Migration (VMware to Hyper-V)

Hello everyone, I am currently executing an internal infrastructure migration project moving our environment from VMware to Microsoft Hyper-V, and I need some clarification on SQL Server licensing compliance during the transition phase. Current…

SQL Server Database Engine
asked 2026-07-30T16:48:14.3766667+00:00
Sang. Truong Tan 0 Reputation points
edited an answer 2026-08-21T12:07:05.3766667+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
4 answers One of the answers was accepted by the question author.

What are the best practices for improving SQL Server database performance?

I’m learning SQL Server and would like to understand the most important practices for keeping a database performant . Which areas should I focus on first, such as indexing, query optimization, statistics, execution plans, and database configuration?

SQL Server Database Engine
asked 2026-08-19T09:46:58.73+00:00
Steve John 20 Reputation points
accepted 2026-08-21T10:32:36.46+00:00
Steve John 20 Reputation points
1 answer

AG instance not in sync

We have 8 databases in an instance. All 8 databases are members of Availability Group. On the secondary replica, the whole instance is not synchronizing . Could you please advise how to bring the secondary instance as synchronized Thanks, Chaitanya

SQL Server Database Engine
asked 2026-07-23T11:50:51.2733333+00:00
Chaitanya Kiran 841 Reputation points
answered 2026-08-21T00:13:15.9866667+00:00
Ben Miller-(DBADuck) 285 Reputation points MVP
3 answers

Database refresh from Production to Dev

We want to restore some databases from Production server to Dev server. We want to create a job that automatically restores a fresh copy of these databases to Dev server on 10th of each month. Could you please advise on how to do this.

SQL Server Database Engine
asked 2026-08-06T19:39:45.92+00:00
Chaitanya Kiran 841 Reputation points
answered 2026-08-20T23:59:01.75+00:00
Ben Miller-(DBADuck) 285 Reputation points MVP
2 answers

On-prem SQL server needs a Trust certificate

Hello Team, We have on-prem SQL Server which is running from Azure VM. From same Azure VM, we have Gateway running as well. However, we are facing an issue while connecting SQL server with PowerBI desktop and Services. For this issue, PowerBI team has…

SQL Server Database Engine
asked 2026-08-19T18:34:42.8+00:00
Hemant 61 Reputation points Microsoft External Staff
answered 2026-08-19T19:35:18.43+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
4 answers

Clarification on MSOLEDBSQL19 Behavior with TrustServerCertificate=True

Hello Team, We are currently using the MSOLEDBSQL19 driver on Windows systems and would like to better understand its connection behavior related to encryption and certificate validation. While testing SQL Server connectivity, we observed that a…

SQL Server Database Engine
asked 2026-07-13T09:22:07.6666667+00:00
Abhishek Modi (amodi) 20 Reputation points
answered 2026-08-19T13:31:03.5966667+00:00
sudhir kumar 0 Reputation points
2 answers

services.exe D:\MSSQL\MSSQL17.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE ACCESS DENIED

I've been getting failed installs with SQL Server Developer Standard Edition on Windows 2025 Standard edition, error has been:  services.exe 1000 QueryOpen D:\MSSQL\MSSQL17.MSSQLSERVER\MSSQL\Binn\sqlceip.exe ACCESS…

SQL Server Database Engine
asked 2026-07-26T15:48:06.9966667+00:00
Iain Barnetson 106 Reputation points
commented 2026-08-13T20:56:16.0866667+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
2 answers

2022 express edition and i have 2025 license

We currently have SQL Server 2022 Express installed on our server while waiting for the SQL Server Standard license. Our application only supports up to SQL Server 2022, and the license provided is also for SQL Server 2022. However, when we performed an…

SQL Server Database Engine
asked 2026-08-13T07:50:47.6733333+00:00
Kenneth Lapuz 0 Reputation points
answered 2026-08-13T14:51:35.7+00:00
Bruce (SqlWork.com) 85,111 Reputation points
1 answer

keep getting random errors everytime i try to restore a database

Hello, I would love to have some remote assistance with my issue. I'm trying to restore a database from an old computer to a new one, but the old computer is on version 12 and any new computer I try to use wants me to upgrade to version 22, and I keep…

SQL Server Database Engine
asked 2026-08-10T15:54:44.6833333+00:00
Alex Negrich 0 Reputation points
edited an answer 2026-08-10T18:43:54.4133333+00:00
Deepesh Dhake 840 Reputation points
2 answers

AUTOMATIC_TUNING

i got this error when run the alter statement in sql server standard edition 2017 and above version on-premises environment, Note that querystore already enabled without any issues ALTER DATABASE current SET AUTOMATIC_TUNING (FORCE_LAST_GOOD_PLAN =…

SQL Server Database Engine
asked 2026-08-10T11:28:43.99+00:00
Alagarsamy Sundararajan 0 Reputation points
edited the question 2026-08-10T12:16:51.6766667+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
2 answers

How to find and replace table name changes in stored procedures

I have create a SQL database with several tables and some stored procedures. Now I want to change the name of some of the tables. How can I get it to find and replace the changed table name in the stoed procedures

SQL Server Database Engine
asked 2026-08-10T03:21:27.73+00:00
Michael Boahene 0 Reputation points
answered 2026-08-10T06:59:47.63+00:00
Erland Sommarskog 136.8K Reputation points MVP Volunteer Moderator
2 answers

sql server management studio 2018 user setup

how to set up user account and login for sql server management studio 2018 and connect to database

SQL Server Database Engine
asked 2026-07-06T22:12:14.9133333+00:00
Candace Snipes 20 Reputation points
commented 2026-08-09T02:25:21.9866667+00:00
Ganesh Chelluri 190 Reputation points Microsoft External Staff Moderator