Forum Replies Created

Viewing 15 posts - 106 through 120 (of 2,462 total)

  • RE: When someone asks you what you do for work, how do you answer?

    Unless it's someone in my field I say "computer stuff". Anything beyond that I generally get a blank stare.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: The GDPR is Coming to the US

    Jason A. Long - Monday, July 9, 2018 11:26 AM

    How about, "Nothing is free. If you aren't paying for it, you're...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Joining on the numeric part of string...

    pietlinden beat me to it - here's what that solution would look like:

    -- Sample data
    USE tempdb
    GO
    IF OBJECT_ID('dbo.t1') IS NOT NULL DROP TABLE dbo.t1;

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Get first date and last date of the current month base on Work Week

    I'm stuck on the last Sunday at the moment but here's how you handle the first Monday. 
    Lynn Pettis has a great post about common date routines.  I...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Single value in selection with groups

    This perhaps? 

    SELECT FullName, NewType, SUM(Amount1), SUM(Amount2)
    FROM
    (
    SELECT TOP (1) FullName, NewType, Amount1, Amount2
    FROM @test-2
    ORDER BY TDate...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Calculating Work Days

    I stumbled across this while looking to create my own and would like to propose a couple changes:  
    First, I have noticed lately moving filters from a WHERE clause to a...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How to get Last Occurance of % value in the string...

    Sergiy - Friday, June 1, 2018 7:05 AM

    Alan.B - Tuesday, May 29, 2018 11:29 AM

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How to get Last Occurance of % value in the string...

    ChrisM@Work - Tuesday, May 29, 2018 10:07 AM

    Using Jeff Moden's et al's splitter makes this very easy. Split on spaces,...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Array in specific columns

    Can you provide an example of what the array looks like and what type of array it is? 

    Problem is that the array can contain up to 250...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Performance Question

    Fixing your data model to avoid this type of tomfoolery is always my first choice.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Frustrating Ola Hallengren log file (ldf) backup issue

    Thanks folks for the replies. After a little more research I discovered that the problem was related to periodic connectivity issues between the server and the SAN. I never saw...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Frustrating Ola Hallengren log file (ldf) backup issue

    Beatrix Kiddo - Wednesday, May 9, 2018 6:12 AM

    I'm sure you've tried this already, but have you tried explicitly granting permissions (to...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Remove duplicate substrings from string

    Another really fast way to tackle this (using NGrams8k - link is in my signature):

    SELECT *
    FROM #stringsplit s
    CROSS APPLY
    (
    SELECT STUFF(REPLACE((

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: TRIM() in T-SQL

    I must admit, when I saw the title, TRIM() in T-SQL my first thought was, "boring!" 
    That said - I was quite impressed and found the article to be quite...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Inside the SQL Server Query Optimizer

    david.stephens - Friday, April 6, 2018 2:16 PM

    I had the same issue not seeing an obvious way to submit my information or...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 106 through 120 (of 2,462 total)