Get concatenated value for a column without cursor
This script provides comma separated values of one column for each value of another column. It provides it in SQL 2005 without using cursor.
2010-07-06 (first published: 2010-06-14)
2,323 reads
This script provides comma separated values of one column for each value of another column. It provides it in SQL 2005 without using cursor.
2010-07-06 (first published: 2010-06-14)
2,323 reads
This is a quick way of outputting the location of your database files/dbsize/date created on your instance.
2010-07-02 (first published: 2010-06-06)
1,384 reads
SCRIPT TO RESTORE BACKUP FOR ALL DATABASES, PLACED IN FOLDER CALLED
ORIGIN_FOLDER, WITH THE INITIALS 'DBVF' AND EXTENSION '.BAK'
2010-06-30 (first published: 2010-06-08)
2,845 reads
2010-06-29 (first published: 2010-06-09)
1,184 reads
This function finds the ratio betwen two numbers.Just plug into your SP and enjoy.
2010-06-23 (first published: 2010-06-01)
2,262 reads
Helps to get the default value of parameters from stored procedures and functions.
2010-06-22 (first published: 2010-05-26)
3,444 reads
I prepared this version (my original did not used XML)
By being helped by forums feedback from SQL central
Forward it to yours peers.
2010-06-15 (first published: 2010-05-13)
1,898 reads
As the undocumented SQL Server 2000 function xp_getfiledetails is not existent any more in 2005 or later i needed a replacement...
2010-06-14 (first published: 2010-05-07)
3,643 reads
IsNumber does weak checking and fails cast to BigInt so I wrote IsBigInt to replace it.
2010-06-11 (first published: 2010-05-05)
3,519 reads
Sometimes you need to scan a large number of datetime columns for most recent access.
2010-06-08 (first published: 2010-05-04)
1,874 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