SQL Server – Kill all sessions using database
Before an existing database can be restored, there should be connections using the database in question. If the database is...
2013-11-25
1,457 reads
Before an existing database can be restored, there should be connections using the database in question. If the database is...
2013-11-25
1,457 reads
Before an existing database can be restored, there should be connections using the database in question. If the database is...
2013-11-25
98 reads
Stuff function: - This function is used to replace string from the given start position, passed as 2nd argument with string...
2013-11-25
34,562 reads
Quick script just to give you an idea of how your databases are being used. Mainly useful for exploring.
select db.name...
2013-11-25
8,906 reads
Well, do you know? You’re the DBA, the guy in charge, the guy who gets pounced on first thing in...
2013-11-25
902 reads
Introduction
A few days ago, I did a presentation for a Virtual Chapter meeting where I discussed SQL Server Data Access...
2013-11-24
960 reads
Backing up SQL Server Databases
Backing up your SQL Server database is essential for protecting your data. The word Backup refers...
2013-11-23
3,218 reads
(Be sure to checkout the SQLpassion Online Academy, where you get High-Quality SQL Server Trainings with Instant Access!)
Today I have...
2013-11-23
1,669 reads
If you’re a training provider and I’ve missed you, please drop me a line at brian {dot} kelley {at} sqlpass...
2013-11-22
357 reads
It’s Friday, time to look back at the most popular RealSQLGuy posts of the week. Because it’s Friday and you’re...
2013-11-22
474 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