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

Guest Columnist: Jeff Moden

SQLServerCentral.com profile

   Items 1 to 20 of 33    Older >>
 

Finding “Active” Rows for the Previous Month (SQL Spackle)

SQL Server MVP Jeff Moden walks us through the classic problem of finding all the "Active" rows for the previous month using start and end dates. This is excellent for those new to T-SQL.  Read more...
By Jeff Moden 2014/01/30 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 6,165 reads

Skipping Columns (& other tricks) Using BCP Format Files (SQL Spackle)

BULK INSERT and BCP are powerful, high performance tools for importing text files. SQL Server MVP Jeff Moden gives us several nifty tips in this introduction to BULK INSERT and BCP Format Files including "Skipping Columns" and the sequestration of bad rows while still loading all the good data.  Read more...
By Jeff Moden 2014/01/23 | Source: SQLServerCentral.com | Category: bcp (bulk copy program)
Rating: |  Discuss |   Briefcase | 4,986 reads

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,666 reads

A Simple Formula to Calculate the ISO Week Number

He admits it wasn't his idea but his head sure wishes it was. SQL Server MVP Jeff Moden explains a wonderful, super simple, very high performance formula that will calculate ISO Week Numbers. If you're "stuck" with SQL Server 2005 or less, you're going to like this a whole lot!  Read more...
By Jeff Moden 2013/04/08 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 7,623 reads

Hierarchies on Steroids #2: A Replacement for Nested Sets Calculations

In this sequel to his first "Hierarchies on Steroids" article, SQL Server MVP Jeff Moden shows us how to build a pre-aggregated table that will answer most of the questions that you could ask of a typical hierarchy. Any bets on whether Santa is packin’ a Tally Table in his bag or not?  Read more...
By Jeff Moden 2012/11/15 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 7,849 reads

Hierarchies on Steroids #1: Convert an Adjacency List to Nested Sets

SQL Server MVP Jeff Moden shows us a new very high performance method to convert an "Adjacency List" to “Nested Sets” on a million node hierarchy in less than a minute and 100,000 nodes in just seconds. Not surprisingly, the "steroids" come in a bottle labeled "Tally Table".  Read more...
By Jeff Moden 2014/09/19 (first published: 2012/11/13) | Source: SQLServerCentral.com | Category: hierarchy
Rating: |  Discuss |   Briefcase | 15,216 reads

How to Make Scalar UDFs Run Faster (SQL Spackle)

It's a well known fact that Scalar UDFs are the stuff of performance nightmares in T-SQL. But are they really as bad as they say? SQL Server MVP Jeff Moden shows us that they might not really be as big a problem as you might think and what you can do when they actually are.  Read more...
By Jeff Moden 2014/06/24 (first published: 2012/08/01) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 15,303 reads

Generating Test Data: Part 2 - Generating Sequential and Random Dates

Part two of this fantastic series from Jeff Moden looks at generating date data, something which can be handy for any number of testing purposes.  Read more...
By Jeff Moden 2012/04/25 | Source: SQLServerCentral.com | Category: test data
Rating: |  Discuss |   Briefcase | 5,224 reads

Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

A simple problem that can become complex in T-SQL. How do you find the rows that match 2 conditions, but not a third, in an efficient manner. MVP Jeff Moden gives us a solution.  Read more...
By Jeff Moden 2014/06/06 (first published: 2012/03/29) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 21,938 reads

Generating Test Data: Part 1 - Generating Random Integers and Floats

Learn how you can easily generate large amounts of test data efficiently in this new series from Jeff Moden. Part 1 covers integers and floating point values.  Read more...
By Jeff Moden 2012/03/26 | Source: SQLServerCentral.com | Category: data generation
Rating: |  Discuss |   Briefcase | 7,107 reads

Hidden RBAR: Counting with Recursive CTE's

"Counting" is essential to many high performance code techniques. SQL Server MVP, Jeff Moden, shows us how to make sure that we're "Counting" and not "Crippling" our trick-code.  Read more...
By Jeff Moden 2011/08/08 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 11,764 reads

Tally OH! An Improved SQL 8K “CSV Splitter” Function

The Tally Table has proven to be a simple and elegant method for avoiding many varieties of RBAR. Unfortunately, one of its more common uses, that of a CSV splitter, has a well-known and serious performance problem. MVP Jeff Moden shows us what that problem is and how to correct it. (UPDATED with additional info and attachments on 5/12/2011).  Read more...
By Jeff Moden 2012/12/28 (first published: 2011/05/02) | Source: SQLServerCentral.com | Category: tally table
Rating: |  Discuss |   Briefcase | 48,360 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,605 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,823 reads

Formatting Dates with 3 Character Months (SQL Spackle)

Another in the series of articles to help you "fill in the cracks" in your T-SQL knowledge. MVP Jeff Moden shows us a super simple, high performance method to solve this timeless problem.  Read more...
By Jeff Moden 2013/07/19 (first published: 2011/01/20) | Source: SQLServerCentral.com | Category: formatting
Rating: |  Discuss |   Briefcase | 17,977 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,987 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 | 15,226 reads

Why doesn’t ISNUMERIC work correctly? (SQL Spackle)

Another in our series of articles to help you fill in the cracks in your knowledge with SQL Spackle. MVP Jeff Moden shows us how IsNumeric works and how you should use it.  Read more...
By Jeff Moden 2012/09/14 (first published: 2010/12/01) | Source: SQLServerCentral.com | Category: isnumeric()
Rating: |  Discuss |   Briefcase | 33,061 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,967 reads

Dissecting SQL Server Execution Plans

A review of MVP Grant Fritchey's "Dissecting Execution Plans". This is one book that you'll want on your bookshelf.  Read more...
By Jeff Moden 2009/12/17 | Source: SQLServerCentral.com | Category: book reviews
Rating: |  Discuss |   Briefcase | 4,746 reads
   Items 1 to 20 of 33    Older >>