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.
35,034 questions
3
votes
1
answer
217
views
When do we actually need SQL Server logins for machine accounts (DOMAIN\SERVER$)?
I found this error in my SQL Server error log:
Login failed for user 'domain\myserver$'. Reason: Could not find a login matching the name provided
Where domain is the domain name and domain is a ...
1
vote
1
answer
69
views
UDF vs other solutions for checking valid data
I have many 'title' and 'name' columns in different tables that have the same set of restrictions about what characters can be inserted and what not. For example, names should only allow alphabet plus ...
0
votes
0
answers
30
views
AzureSQL - JDBC - Threads hung over socket read
I have a Java application with an ETL process running with Azure SQL DB and some times the processing just freezes but the app still runs. I did some thread dump analysis and found that during this ...
4
votes
2
answers
524
views
Performance tanks after small change in search date predicate
Can anyone help me understand what's happening here....
I'm trying to get consistent performance from a query being called from a third-party application. Changing the query itself isn't an option. ...
0
votes
0
answers
56
views
Removing Text Columns to Alleviate Indexing Issues
I have a couple of tables in a database which I inherited which have NVARCHAR(MAX) columns.
Now that the data is several million rows, adding an index takes a long time and because of those columns, I ...
7
votes
1
answer
658
views
How to release unused space? [duplicate]
I have a large table which has a ton of unused space. I updated the table recently and NULLed out a varbinary (max) column that we didn't need. This has created a lot of unused space:
EXEC ...
-1
votes
1
answer
41
views
After a failover to a DR region, the becomes "reverting/in Recovery" in the primary node
we have a 10+TB database. Whenever we failover it, the databases becomes with a session running a null command, with a HADR_DB_COMMAND wait_type.
I believe this is related to a rollback or something? ...
-1
votes
0
answers
54
views
Sql server query use Nested loop instead of Hash join
I have a Database A where a subset of tables is replicated on Database B
On Database B, I have created a few views and Indedexed view.
I have a query on these views.
In my local the query is always ...
0
votes
1
answer
64
views
What does trace flag 11024 do?
Context
I have been experimenting with incremental statistics a lot. I do not know of any online resource about them that I have not read. Despite all of this, I just don't understand what trace flag ...
0
votes
0
answers
34
views
Under what circumstances will a memory optimized table variable with a hash index outperform other temporary tabular structures?
Context
Aside from victims of latch contention, everybody gave up on memory-optimized table variables pretty quickly. Probably around the time they realised that they still don't have statistics. Yet, ...
-1
votes
1
answer
81
views
Best Design and Implementation Practices for a long (billions) and narrow table
I am about to start working on a project that aims at modeling all trees in France using the LiDAR coverage of the territory.
I won't get into the detail of the modeling but basically after ...
4
votes
1
answer
668
views
What is Microsoft SQL Server doing when I manually reduce the file size in Database Properties > Files?
In Microsoft SQL Server I can go into Database Properties > Files and change the Size of a file to a lower number. If there's space available, it will actually reduce the file's size, and never ...
0
votes
0
answers
72
views
Temp Table Management in Explicit Transactions and CATCH blocks
Example code below populates a PhoneNumber table and associates those PhoneNumberId's with an OrderNumber.
As written I am getting the error message:
The current transaction cannot be committed and ...
0
votes
1
answer
105
views
How does a join without any predicates estimate fewer rows than what go into it?
Consider the following script on the 10 GB StackOverflow2010 database. Be warned that it clears the plan cache.
IF NOT EXISTS (SELECT * FROM sys.types WHERE is_table_type = 1 AND name = 'ExampleTvp')
...
0
votes
1
answer
64
views
How to perform a sequenced LEFT OUTER JOIN
TL;DR In the book Developing Time-Oriented Database Applications in SQL by Richard T. Snodgrass, section 6.3.1 he demonstrates how to perform a sequenced inner join on a temporal table, but does not ...