How to write a SELECT query
My First SELECT Statement Microsoft SQL Server makes it really easy for us to query tables. In SQL Server Management...
2017-05-24
172 reads
My First SELECT Statement Microsoft SQL Server makes it really easy for us to query tables. In SQL Server Management...
2017-05-24
172 reads
When we want to retrieve information from a database, we query the structure with language appropriate to the database. Remember...
2017-05-17
109 reads
Version numbers are confusing. SQL Server Management Studio (SSMS), the client user interface by which most DBAs access SQL Server,...
2017-05-10
248 reads
By now you will have heard that the next version of SQL Server has been announced. There’s no release date yet,...
2017-05-03
100 reads
You’re reading this series of posts because you want to learn about databases and how to use them. What you...
2017-04-26
104 reads
Taking a short break from the Database Fundamentals series of the last few weeks, I’d like to mention some upcoming...
2017-04-19
117 reads
A friend of mine in the filmmaking business, who is exceedingly bright but has never worked with SQL Server before,...
2017-04-12
106 reads
If there’s one thing that SQL Server is really good at, it’s relationships. After all, a relational database management system...
2017-04-05
119 reads
Phew! There’s a lot to take in with data types, collation, precision, scale, length, and Unicode, and we’re just getting...
2017-03-29
322 reads
Last week, we discussed storing text in a database. This week we will dive deeper into data types. When storing...
2017-03-22
112 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