Powershell script to find new servers in an AD domain
This is actually part of a process I am creating to automatically discover SQL Server instances in an Active Directory domain. So there...
2019-06-19 (first published: 2019-06-06)
1,389 reads
This is actually part of a process I am creating to automatically discover SQL Server instances in an Active Directory domain. So there...
2019-06-19 (first published: 2019-06-06)
1,389 reads
We know that indexes are necessary for query performance but comes with overhead during DML operations. Usually, the overhead is worth the performance gain we get out of them....
2019-06-10 (first published: 2019-05-21)
869 reads
If you are running a DATABASE BACKUP or RESTORE command manually, SQL Server will show you the progress at a specified % completion interval. For the BACKUP, the default is...
2019-06-03 (first published: 2019-05-16)
1,007 reads
The purpose of this query is to find identical duplicate non-clustered indexes i.e. indexes on same table with same columns in same order. If you have a need to...
2019-05-30 (first published: 2019-05-15)
890 reads
I realized yesterday I posted this quickly after testing only against SQL 2016 version. So I decided to also test against SQL 2014 and 2012 versions to make sure...
2019-05-16
75 reads
Deadlocks are usually detected and resolved automatically by SQL Server by killing one of the SPIDs involved in it. You may have an alert setup to notify you and/or users...
2019-05-14 (first published: 2019-05-01)
557 reads
As you may all know, having up to date index statistics is the key to make sure the query optimizer can choose the most optimal execution plan for any...
2019-05-01
182 reads
Suppose you want to or need to know anytime your SQL Server is experiencing blocking where queries are being blocked and it may or may not escalate to a...
2019-04-30 (first published: 2019-04-17)
1,719 reads
select
s.session_id,
db_name(s.database_id) DB,
s.login_time,
s.host_name,
s.program_name,
s.login_name,
s.cpu_time,
s.memory_usage,
s.total_scheduled_time,
s.total_elapsed_time,
s.endpoint_id,
s.last_request_start_time,
s.last_request_end_time,
s.reads,
s.writes,
s.logical_reads,
s.is_user_process,
s.row_count,
s.open_transaction_count,
t.text as [command]
from sys.dm_exec_sessions s
inner join sys.dm_exec_connections c...
2019-04-25
62 reads
For me, this particular code to generate a script to recreate indexes has more practical use in a replication environment.
For example, the default replication setting is to exclude the...
2019-04-25
476 reads
By Steve Jones
I use ConEmu for my terminal interface. I’m still on Windows 10 at home,...
Creating a Fabric workspace takes about 30 seconds. Restructuring workspaces after people have built...
By Steve Jones
It’s a small change, but a handy one. Flyway Desktop (FWD) now includes the...
Comments posted to this topic are about the item Adding new column with DEFAULT...
Comments posted to this topic are about the item Advanced Deployment Scenarios: Stairway to...
Comments posted to this topic are about the item You Need a DBA Pipeline
Which number did the two COUNT(*) return:
DROP TABLE IF EXISTS #tmp CREATE TABLE #tmp (id INT NOT NULL) INSERT INTO #tmp (id) SELECT gs.value FROM GENERATE_SERIES(1, 5) AS gs ALTER TABLE #tmp ADD my_value INT NOT NULL CONSTRAINT df_tmp_my_value DEFAULT 1 SELECT COUNT(*) FROM #tmp AS t WHERE my_value = 1 ALTER TABLE #tmp DROP CONSTRAINT df_tmp_my_value ALTER TABLE #tmp ADD CONSTRAINT df_tmp_my_value DEFAULT 2 FOR my_value SELECT COUNT(*) FROM #tmp AS t WHERE my_value = 1See possible answers