2012-06-20 (first published: 2012-05-30)
8,752 reads
2012-06-20 (first published: 2012-05-30)
8,752 reads
A script to help you find the Precision & Scale parts of a decimal value.
2012-06-19 (first published: 2012-06-04)
4,962 reads
Generate a script of insert statements with column names for any table including those with identity columns.
2012-06-15 (first published: 2012-05-22)
3,143 reads
Sometimes you just need to populate a CHAR/VARCHAR column for testing with a random selection of string literals at table CREATE time. Here is a quick and easy script.
2012-06-14 (first published: 2008-01-16)
1,176 reads
SQL Server 2012 introduces a new string concatenation function. This can be recreated in earlier versions of SQL Server.
2012-06-06 (first published: 2012-05-16)
2,171 reads
These are scripts I run each morning on my registered CMS servers to check immediate health.
2012-06-04 (first published: 2012-05-09)
2,889 reads
The code below uses a CASE STATEMENT to group sales data based on date,week,month and quarter. It should be executed in AdventureWorks 2005 or 2008.
2012-05-30 (first published: 2012-05-10)
2,042 reads
This function returns all the necessary version information in a table.
2012-05-28 (first published: 2012-03-21)
3,165 reads
Script to list out all fragmented indexes for a given database, with options to only view them, reorganize them, or rebuild them in one fell swoop.
2012-05-25 (first published: 2012-05-15)
3,254 reads
Displays the last Full, Diff, and Log backup taken. If no backup has been taken that is displayed as well.
2012-05-24 (first published: 2012-05-15)
1,492 reads
By Steve Jones
Redgate is a for-profit company. We look to make money by building and selling...
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...
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