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
98 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
Before an existing database can be restored, there should be connections using the database in question. If the database is...
2013-11-25
256 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
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
Case Statement/ Expression in SQL server
Sometimes we need to get one result output from multiple possible outcomes based on the...
2013-11-25
1,795 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
AdvertisementsRecently one of my application website went down.
I checked all the basic connectivity troubleshooting and seem everything was looking and...
2013-11-25
1,380 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
(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
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
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