Community recognition
On the first day of January 2017, I was honoured to receive an email naming me as a Microsoft MVP...
2018-07-04
313 reads
On the first day of January 2017, I was honoured to receive an email naming me as a Microsoft MVP...
2018-07-04
313 reads
Folks, we all like to make sure we’re doing our level best to make things work smoothly. So why am...
2018-06-27
374 reads
Last time we looked at DATEPART(). This post is all about the DATENAME() function. So many similarities There are many...
2018-06-20
924 reads
In my previous posts in this series we’ve seen reference to Transact-SQL (T-SQL) functions that are used to get the...
2018-06-13
299 reads
I was minding my own business innocently reading a blog post by Erik Darling, when this tip smacked me in...
2018-06-06
1,151 reads
Recently I wrote a post about date and time functions you should never use, which contained an opinion I’ve expressed...
2018-05-30
456 reads
Last week I had the privilege of reviewing possibly the best SQL Server production environment I’ve seen in Canada. During...
2018-05-23
482 reads
Previously we looked at four built-in functions to get the current date and time in SQL Server and Azure SQL...
2018-05-23 (first published: 2018-05-16)
3,891 reads
Thank you! Thank you for reading my blog. Thank you for buying my book. Thank you for attending my sessions...
2018-05-09
256 reads
It occurred to me that we haven’t covered the TIMESTAMP data type in this series about dates and times. TIMESTAMP...
2018-05-02
276 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