10
votes
Do we have 2 logical query processings, one with indexes and one without indexes?
tl;dr: Query planners are a big deal.
In general, before an RDBMS backend executes a query,
it first plans the query.
There's more than one way to access the data,
and the planner evaluates some of ...
8
votes
Accepted
Unit testing Systems with Logic Tightly Coupled with Data
I've implemented automated testing including the database in a system with some of the same problems. The approach I took was roughly:
Before all unit tests, bring up a DB from scratch with schema ...
4
votes
Unit testing Systems with Logic Tightly Coupled with Data
Assuming all logic is within your DB, in stored procedures, and you simply cannot change that in your project, I'd do the following:
(optional) Refactor your stored procedures in order that each one ...
2
votes
Accepted
T-SQL Development debate, which is the correct approach
This would be better on dba.stackexchange.com
XACT_STATE() does not effect the behavior of the rollback. It is about state.
1 The current request has an active user transaction. The request ...
2
votes
Combine union with distinct
Based on the query you have provided I am assuming the DistinctValue column does not initially give you a set of distinct values so one approach you may try is the following:
SELECT DISTINCT ...
2
votes
Do we have 2 logical query processings, one with indexes and one without indexes?
How is a sql query processed when there are indexes, that is, would
this behavior change?
That diagram describes a process for determining what data a given query will return. It has nothing to do ...
1
vote
How to write robust or alternative to TSQL data processing routines in SqlServer?
Your specific table variable example isn't literally true since table types exist (https://docs.microsoft.com/en-us/sql/t-sql/statements/create-type-transact-sql). So if you have an exact same ...
1
vote
Unit testing Systems with Logic Tightly Coupled with Data
You can try to build mocks, stubs and fakes around your units as replacement for the dependencies.
I haven't got much experience with VB.NET but I'm sure there are unit testing frameworks out there ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tsql × 28sql × 18
sql-server × 14
c# × 4
database × 3
algorithms × 2
asp.net × 2
vb.net × 2
stored-procedures × 2
architecture × 1
object-oriented × 1
unit-testing × 1
.net × 1
testing × 1
database-design × 1
data-structures × 1
performance × 1
tdd × 1
naming × 1
mysql × 1
language-design × 1
entity-framework × 1
learning × 1
orm × 1
xml × 1