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,984 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
5
votes
1
answer
327
views
Meaning of '#' suffix on SQL Server columns
While reading the docs here and there on SQL Server, I saw this request:
SELECT
ROW_NUMBER() OVER(ORDER BY name ASC) AS Row#,
name, recovery_model_desc
FROM sys.databases
WHERE database_id < ...
1
vote
1
answer
48
views
SQL Server deadlock due to clustered index scan (where clustered index seek is better) and unnecessary LCK_M_U
This is a pretty mundane transaction isolation scenario on a OLTP database (Microsoft SQL Server 2022).
Session A and Session B are running concurrently, and this works pretty much as you would expect....
7
votes
1
answer
297
views
Alter table alter column does not work with user defined types
A user with db_datareader, db_datawriter, db_ddladmin and db_securityadmin roles can add columns with a user defined type, but cannot alter those.
For example: Lets say we create a user defined type ...
5
votes
1
answer
188
views
Do I need to run sp_refreshview and sp_refreshsqlmodule after changing column collations?
I look after a database for a vendor’s application that our system team uses to store passwords. This database is part of a three-node AlwaysOn Availability Group. The instance and database currently ...
0
votes
0
answers
31
views
Using Group Managed Service Account to login to SQL Server 2022
Help please!
I have a manual install of SQL 2022 built with the service running as the built in account. I now want to change the service to run as the group managed service account that I now have (i....
0
votes
2
answers
68
views
How to implement redundant databases with mutual synchronization in PostgreSQL or SQL Server
I am writing a program in Golang where I need to set up redundant databases. Here’s the requirement:
I have two databases that act as redundant to each other.
The application first tries to write data ...
1
vote
1
answer
79
views
Matching TDE Certificates with different names across Always On Replica
I created a TDE certificate on the primary node. I then backed it up and copied the files to the secondary.
When I created the cert on the secondary from the backup files, I accidentally created it ...
0
votes
3
answers
71
views
While doing update, accessing records hangs report generation
While doing update, if some one tries to access the records from the same table, the report generation system hangs. Is this related to table lock? If enabled. Will row lock solve the issue? How to ...
5
votes
1
answer
102
views
Why does SQL Server Full Text Search (FTS) rank go down when match count goes up due to highly rare word
Given this query:
declare
@aboutPredicateOpt nvarchar(4000) =
N'IsAbout(
PICCO weight(0.1),
IC228 weight(0.1)
)';
select RowId, BrandId, ...
0
votes
0
answers
21
views
DEA 2.6 Startup Error – MEF GetExportedValue Prerequisite Import Failure
Installing Microsoft Database Experimentation Assistant (DEA) v2.6 on Server 2022 fails to start with:
System.InvalidOperationException: GetExportedValue cannot be called before prerequisite import '...
1
vote
1
answer
91
views
Rollback plan after upgrade from SQL Server 2016 Standard edition to SQL Server 2022 Enterprise edition
I'm planning to upgrade our SQL Server from 2016 Standard edition to 2022 Enterprise edition.
To prepare for potential issues, I want to have a rollback strategy in place. If, after the upgrade, our ...
4
votes
1
answer
2k
views
SQL Server - Payroll query kills database every month
so admittedly I'm not the best at query tuning, and could really use some guidance on how to tune this query. It's a month end payroll query that pulls A LOT of data, but ultimately doesn't need all ...
1
vote
1
answer
34
views
RDS master user shouldn't be able to query msdb
I don't like working in RDS. I can't even query sysjobschedules with my Master user
This data isn't completely gated off from me. For example I can see the schedule data in the job management UI.
I ...
2
votes
2
answers
107
views
How can I tell if my BPSORT waits are the result of spilling batch mode sorts?
BPSORT sort waits mean that I have batch mode sorts. This is okay. However, I'm aware that batch mode sort spills are very slow. How can I tell if a query that appears to have high BPSORT waits is ...
0
votes
0
answers
12
views
RML Utilities – DTCTransaction EndTime Column Missing in Trace
While learning RML Utilities, I’m trying to generate an .RML file using ReadTrace. The tool fails because the trace must include the DTCTransaction event and its EndTime column, but EndTime is not ...