Home Forums SQL Server 7,2000 T-SQL What is your favorite "I didn't know that" moment in T-SQL? RE: What is your favorite "I didn't know that" moment in T-SQL?

  • I think one of my first "eureka" moment - as Jeff calls it - was when I read Jeff's article about the Tally table 😀 The "Numbers" or "Tally" Table: What it is and how it replaces a loop.[/url]

    Before that I used to create date dimensions with a WHILE loop, and I was so proud I didn't use a cursor. Ahem... :blush: Now I create my date dimensions in just a few milliseconds.

    Another one was when I read another article by Jeff, called REPLACE Multiple Spaces with One[/url], which presents a really clever way to clean-up your data without nesting endlessly replace statements (it can replace any number of spaces with 3 REPLACE functions).

    Regarding SSIS, which I do most of the time, this little nugget by Jamie Thomson really rocked my brain: FileNameColumnName property, Flat File Source Adapter. Simple, but effective.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP