Remove comments from the SQL Code
Takes text (varchar(max)) as input and strips out any comments and RETURN the string. Comment is replaced by new-line character.
2012-07-04 (first published: 2009-03-25)
2,611 reads
Takes text (varchar(max)) as input and strips out any comments and RETURN the string. Comment is replaced by new-line character.
2012-07-04 (first published: 2009-03-25)
2,611 reads
2012-07-03 (first published: 2012-06-21)
1,388 reads
This scripts allows to store all tables names in all databases for the current server, it stores also the creation date, this script can be runned ins SQL Server 2000 or later
2012-07-02 (first published: 2012-06-25)
1,521 reads
Will list Table Name, Constraint name and Primary Key Column Name.
2012-06-29 (first published: 2008-03-20)
2,515 reads
Delete Log-shipping Tlog backup files which are already restored onto Secondary Server.
2012-06-28 (first published: 2012-06-06)
717 reads
2012-06-26 (first published: 2012-06-07)
1,476 reads
This script will search the entire server and give the name and schema of the database where the table exists.
2012-06-25 (first published: 2012-06-09)
1,491 reads
This script uses a cursor to loop through all tables and get the count and table sizes using sp_spaceused. It is much faster and efficient than use 'SELECT COUNT(*) FROM TABLE_NAME'.
2012-06-22 (first published: 2012-06-09)
2,004 reads
Delete Duplicates in SQL Server without using Cursor or Temporary tables
2012-06-21 (first published: 2006-11-22)
3,259 reads
2012-06-20 (first published: 2012-05-30)
8,779 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