Questions tagged [sql-server]
All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag, like sql-server-2016, since it is often relevant to the question.
34,418
questions
1
vote
1
answer
33
views
Does enabling backup compression in a Back Up Database Task enable checksums, no matter what setting you pick for them?
Observations
The documentation says
To enable backup checksums in a BACKUP (Transact-SQL) statement, specify the WITH CHECKSUM option. To disable backup checksums, specify the WITH NO_CHECKSUM option....
0
votes
0
answers
23
views
SQL server granular control over auto update statistics
I wanted to know if we get more granular control over auto update statistics at the index level in SQL server.
One of my DBs with auto update stats enabled recently started to have some behavioral ...
2
votes
1
answer
65
views
What kinds of operations could cause a "Temp table changed" recompilation?
Frequent recompilation happens in one SP with 'Temp table changed' cause. What kinds of operations on temp table would trigger this? There are no alter and create index operations on temp table, just ...
0
votes
1
answer
28
views
Is DBCC CHECKFILEGROUP worthless if you already run DBCC CHECKDB on all databases?
DBCC CHECKDB makes many other integrity checks redundant, but I can't see anything in the documentation saying if it makes DBCC CHECKFILEGROUP redundant. Is DBCC CHECKFILEGROUP worthless if you ...
-2
votes
0
answers
27
views
SQL Server: Two MERGE statements are blocking each other on a large partitioned table
Have a large table partitioned on an INT column. When I run two different MERGE statements on two different partitions of this table, they seem to be blocking each other.
Example:
-- Large table ...
0
votes
1
answer
33
views
How do I consolidate the related mappings?
I have a table which has mappings coming from different sources (one row for each source) for three different identifier types (idtype1 to idtype3) with idtype1 having the highest priority and idtype3 ...
1
vote
1
answer
45
views
Need to add user and assign roles automatically, using DDL Trigger, when database is created
I am trying to create an automated process that will add a user and assign them the roles of db_datareader, db_datawriter and db_ddladmin whenever a database starting with PA is created. I have ...
0
votes
0
answers
1
view
Version incompatibility error between the SQL-Server database backup and the SQL Server running in the Docker container on my Ubuntu 20.04 VPS
I have installed Docker and run a container on my Ubuntu VPS for resolving the version incompatibility between SQL Server and the backup file but even docker has not solved. During restoring the ...
0
votes
0
answers
30
views
Transactional replication is trying to update a row that does not exist yet. Why?
I've been tinkering with SQL Server 2019 and transactional replication for a little while now and I've hit a wall. Looking at the replication monitor I'm seeing the error "The row was not found ...
-4
votes
1
answer
57
views
Reorganize or Rebuild Spatial Indexes
Will there ever be a way to exclude or only include spatial indexes from the IndexOptimize tool?
0
votes
0
answers
54
views
Problem with many connections from RHEL 8.10 to SQL Server
I have simple script:
for i in {1..1000}
do
isql -v -k "Driver={ODBC Driver 17 for SQL Server};Server=mssqlserver,1282;Database=dbname;UID=user;PWD=xxx;Encrypt=no" >> aaa.log &
...
-2
votes
0
answers
72
views
Why would email alerts on severity 16 errors be desirable? [closed]
Errors for severities beyond 16 are standard. Such errors are signs of really serious problems. I've noticed that this script here includes alerts for severity 16. To my knowledge, severity 16 errors ...
2
votes
1
answer
130
views
Abnormal behavior in TempdB SQL Server 2019
We have recently migrated from a version of SQL Server 2014 to a SQL Server 2019 CU 26.
In all our tests everything went well before performing the migration but when we made the move to production ...
0
votes
0
answers
43
views
High CPU utilization on an idle SQL Server instance without user traffic
We have an SQL Server 2022 CU13 Enterprise on a Windows 2022 VM with 8 vCPU. The sqlserver.exe process shows a high CPU utilization between 10-15% even when there is no user generated load (meaning ...
1
vote
0
answers
23
views
How to audit server settings configuration changes other than view server state?
I want to capture the audit of server configuration settings changes.
For this I setup the SERVER_OPERATION_GROUP audit event.
This event is raised when Security Audit operations such as altering
...
0
votes
1
answer
37
views
sql server client network utility - how to list the aliases?
there is something called sql server client network utility
it lives on
C:\Windows\System32 for 64 bits.
as you can see I have many aliases there, server, instance and ip address and port used for ...
0
votes
0
answers
38
views
How do you fix parameter sniffing on an ORM / Entity Framework Query?
We have a problem with plan cache bloat due to unparameterized Entity Framework queries. In cleaning some of these up we've seen dramatic reduction in SQL CPU usage. I'm inclined to go "clean up ...
-1
votes
0
answers
48
views
Best Practices for Migrating 2TB MSSQL Databases with High Availability to PostgreSQL
I'm planning to migrate a large-scale MSSQL environment to PostgreSQL and would appreciate some advice and best practices. Here are the details of our current setup:
Current Environment:
Two servers ...
-1
votes
0
answers
78
views
Tempdb is growing too fast
I execute an INSERT on a temporary table in SQL Server 2022, but after 8 minutes of execution, 500GB of disk where the TEMPDB files are located ends up.
"Could not allocate a new page for ...
0
votes
2
answers
79
views
create_date and modify_date for sys.objects in MSSQL shows same date
I am trying to figure out when is the create date of a user defined object in the database.
but when I ran a select query on sys.sysobjects, it seems create_date is the same as modify_date.
Is this by ...
-2
votes
0
answers
49
views
SQL Server partition recreate procedure blocked by other queries
I use every night partition recreate procedure which create a new partition for 5 tables in SQL Server.
The partition recreate procedure is blocked by other DML queries which eventually get timeout (...
2
votes
3
answers
564
views
Are unique filtered indexes considered an antipattern for enforcing constraints?
I have a table, such as the following. Let's called it Fools.
FoolID
FoolValue
IsActiveFoolValue
1
Ultra Foolish
0
1
Super Foolish
1
2
Quite Foolish
1
A business rule is that for each FoolID, we ...
-1
votes
1
answer
52
views
What is the purpose of parent_plan_handle in sys.dm_exec_cached_plans?
I am attempting to prove whether the plan cache is caching statements individually within multiple stored procedures with identical statements. I thought I would be able to use parent_plan_handle to ...
0
votes
0
answers
21
views
Manual Failover of SQL Server Distributed Availability Group
Is anyone able to kindly shed some light on an issue for me please? I have two Distributed Availability Group environments, one is SQL 2019 and the other is SQL 2022. The SQL 2019 environment is fine, ...
0
votes
0
answers
28
views
Process to remove High availability and Break the cluster
We have a 4 node High availability group. We now will have to make the primary a standalone server and remove all the replicas and break the cluster.
Before we attempt this on production below is what ...
0
votes
1
answer
96
views
Simple query taking way too long
I have a simple query, using an indexed column, on a very small data set, returning 1 row, hitting Azure SQL Database - taking over 1/2 second. Another earlier execution of this query took 38ms.
...
-1
votes
1
answer
33
views
SQL Server Management Studio "Key cannot be null" error when giving a specific user permissions on Stored Procedures
I'm attempting to give a specific user execute permissions on a Stored Procedure. When I attempt to do so, I get an error:
Key cannot be null. Parameter name: key (System)"
When I attempt to ...
0
votes
1
answer
53
views
Sql Agent jobs, execution contexts, run as issues
We're on Sql Server 2019.
We have a whole bunch of Sql Agent jobs and pretty much by default they are owned by sa.
The company security team issued an edict that all sa accounts are to be disabled for ...
0
votes
0
answers
73
views
SQL Agent Full Backup Job - Not enough disk space when there is enough
We have this Full Backup job, which since we have set it up it always fails every 2 to 3 times. In the log message there are several points that stood out to me:
Code: 0xC002F210
Executing the query &...
0
votes
2
answers
50
views
Yet another Replicated transactions are waiting for next Log backup or for mirroring partner to catch up
We have a partial transactional replication setup in our environment to make a data subset available to another application.
Application Server 1 -> Tables1.row1/row2/row3 -> Application Server ...