Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Content with tags T-SQL, SQL Spackle Rss

   Items 1 to 14 of 14   
 

Calculating Duration Using DATETIME Start and End Dates (SQL Spackle)

It's an old problem with a solution that's nearly as old. SQL Server MVP Jeff Moden shows us the old trick mixed with a slick trick to format the duration as extended hours, minutes, seconds, and milliseconds.   Read more...
By Jeff Moden 2014/01/16 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 10,526 reads

Hidden Formatting Troubles with STR() (SQL Spackle)

Fill in another bit of your T-SQL knowledge about STR(). It right justifies, rounds, and controls the output width of columns. Sounds perfect but here's why you might not want to use it.  Read more...
By Jeff Moden 2014/01/02 (first published: 2010/12/15) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 10,963 reads

Group Islands of Contiguous Dates (SQL Spackle)

Fill in another bit of your T-SQL knowledge by learning how to quickly group ranges of contiguous dates without RBAR.  Read more...
By Jeff Moden 2013/10/04 (first published: 2010/12/07) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 14,888 reads

Displaying Sorted Hierarchies (SQL Spackle)

Learn how you can query a hierarchy of data and also return the results in an ordered fashion. A handy T-SQL skill that you will use over and over again.  Read more...
By Jeff Moden 2013/08/23 (first published: 2011/03/10) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 16,479 reads

Sorting Months By Number (SQL Spackle)

Fill in another bit of your T-SQL knowledge by learning how to sort a result set by the proper month order, but use the month name instead.  Read more...
By Jeff Moden 2013/08/02 (first published: 2010/11/15) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 17,923 reads

Display More Than 8000 Characters (SQL Spackle)

SQL Server MVP Jeff Moden shows us a quick and dirty bit of SQL Spackle to display the content of VARCHAR(MAX) and NVARCHAR(MAX).  Read more...
By Jeff Moden 2013/06/28 (first published: 2011/01/27) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 18,750 reads

Returning the Top X row for each group (SQL Spackle)

One of the most common T-SQL questions is on returning a ranked result set for each member of a group. Dave Ballentyne brings us a short tutorial on how you can do this in T-SQL.  Read more...
By Dave Ballantyne 2012/11/23 (first published: 2010/12/06) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 28,846 reads

Returning 0's in a SUM (SQL Spackle)

Learn how you can sum data by hour and by day while showing 0 values in your result sets for those time periods without a sum in this short article by Patrick Cahill.  Read more...
By Patrick Cahill 2011/06/13 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 7,748 reads

Displaying Sorted Hierarchies (SQL Spackle)

Learn how you can query a hierarchy of data and also return the results in an ordered fashion. A handy T-SQL skill that you will use over and over again.  Read more...
By Jeff Moden 2013/08/23 (first published: 2011/03/10) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 16,479 reads

Display More Than 8000 Characters (SQL Spackle)

SQL Server MVP Jeff Moden shows us a quick and dirty bit of SQL Spackle to display the content of VARCHAR(MAX) and NVARCHAR(MAX).  Read more...
By Jeff Moden 2013/06/28 (first published: 2011/01/27) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 18,750 reads

Hidden Formatting Troubles with STR() (SQL Spackle)

Fill in another bit of your T-SQL knowledge about STR(). It right justifies, rounds, and controls the output width of columns. Sounds perfect but here's why you might not want to use it.  Read more...
By Jeff Moden 2014/01/02 (first published: 2010/12/15) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 10,963 reads

Group Islands of Contiguous Dates (SQL Spackle)

Fill in another bit of your T-SQL knowledge by learning how to quickly group ranges of contiguous dates without RBAR.  Read more...
By Jeff Moden 2013/10/04 (first published: 2010/12/07) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 14,888 reads

Returning the Top X row for each group (SQL Spackle)

One of the most common T-SQL questions is on returning a ranked result set for each member of a group. Dave Ballentyne brings us a short tutorial on how you can do this in T-SQL.  Read more...
By Dave Ballantyne 2012/11/23 (first published: 2010/12/06) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 28,846 reads

Sorting Months By Number (SQL Spackle)

Fill in another bit of your T-SQL knowledge by learning how to sort a result set by the proper month order, but use the month name instead.  Read more...
By Jeff Moden 2013/08/02 (first published: 2010/11/15) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 17,923 reads
   Items 1 to 14 of 14   
 
Tags
date manipulation (2)    
cte (1)    
datetime (1)    
duration (1)    
hierarchy (1)    
management studio (ssms) (1)    
string manipulation (1)