2012-07-06 (first published: 2012-06-29)
999 reads
2012-07-06 (first published: 2012-06-29)
999 reads
2012-07-05 (first published: 2012-06-15)
941 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,596 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,508 reads
Will list Table Name, Constraint name and Primary Key Column Name.
2012-06-29 (first published: 2008-03-20)
2,493 reads
Delete Log-shipping Tlog backup files which are already restored onto Secondary Server.
2012-06-28 (first published: 2012-06-06)
709 reads
2012-06-26 (first published: 2012-06-07)
1,456 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,477 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)
1,987 reads
Delete Duplicates in SQL Server without using Cursor or Temporary tables
2012-06-21 (first published: 2006-11-22)
3,246 reads
If you've ever loaded a 2 GB CSV into pandas just to run a...
By James Serra
What problem is Fabric Ontology trying to solve? For years, most data conversations have...
By Steve Jones
Recently I ran across some code that used a lot of QUOTENAME() calls. A...
Comments posted to this topic are about the item The New Software Team
Comments posted to this topic are about the item Database Mail in SQL Server...
Comments posted to this topic are about the item The string_agg function
We create the following table and then insert some records in it:
create table t1 ( id int primary key, category char(1) not null, product varchar(50) ); insert into t1 values (1, 'A', 'Product 1'), (2, 'A', 'Product 2'), (3, 'A', 'Product 3'), (4, 'B', 'Product 4'), (5, 'B', 'Product 5');What happens if we execute the following query in both Sql Server and PostgreSQL?
select id,
category,
string_agg(product, ';')
over (partition by category order by id
rows between unbounded preceding and unbounded following) as stragg
from t1; See possible answers