Dates and Times in SQL Server: DATETIME2
This post continues our look at date and time data types in SQL Server. SQL Server 2008 introduced new data...
2018-03-21
354 reads
This post continues our look at date and time data types in SQL Server. SQL Server 2008 introduced new data...
2018-03-21
354 reads
There are several different options available for working with tabs and spaces in SSMS. In fact, there are enough that...
2018-03-29 (first published: 2018-03-21)
2,953 reads
Have you ever had an issue where TempDB was filling up on your secondary replicas? Do those secondaries happen to...
2018-03-28 (first published: 2018-03-21)
3,953 reads
This is the second article in the “Backup and Restore (or Recovery) in SQL Server” stairway series (see the full...
2018-03-21
319 reads
You need to move a table from one instance to another with the following requirements:
The instances are on separate domains....
2018-03-21
374 reads
A simple get-help output
PowerShell is a .Net based command line tool designed for automation.
It is recommended to script repetitive task...
2018-03-21
316 reads
I had recently installed the SQL Toolbelt from Redgate at a client site on a laptop they’d supplied me.
(Fantastic product...
2018-03-21
382 reads
It is fun working with SQL/Application developer where you exchange a lot of technical thoughts to find the root of...
2018-03-21
7,327 reads
Installing R packages in SQL Server 2017 is a breeze with the stored procedure sp_execute_external_script. But so far, it is limited...
2018-03-20
462 reads
Given that Microsoft now considers Linux a ‘first-class citizen’, SQL Server 2017 offers native support for Linux. It is engineered...
2018-03-20
361 reads
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...
By Steve Jones
Software is hard. While I love our Lucid Gravity, I realize that they are...
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