Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 2,462 total)

  • RE: Stairway to Advanced T-SQL Level 1: Introduction to Advanced Transact SQL Stairway and Using the CROSS JOIN Operator

    Jacob Wilkins (2/19/2016)


    kkilsby (2/19/2016)


    Doesn't the SQL DB engine first create a cross join for any query involving more than one table? So performance isn't an issue for a cross join...

    "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: Creating Filtered Index with OR Statement

    Bill Talada (2/19/2016)


    I often create two filtered indexes when I have a need for an OR.

    What does that accomplish?

    "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: Surfing

    How many of you have gotten up before dawn, driven to the coast, gotten on a long piece of fiberglass and paddled into the ocean before turning around to ride...

    "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: Using Parameters in a Query is Killing Performance

    Jacob Wilkins (2/17/2016)


    Alan.B (2/17/2016)


    The UpdateDt column in the Users table is DATETIME so I wouldn't expect any datatype conversion issues.

    Perhaps... To know for sure check the query plan (the actual...

    "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: SELECT .. INTO to replace empty string or NULL value

    No problem. 😎

    "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: Using Parameters in a Query is Killing Performance

    The UpdateDt column in the Users table is DATETIME so I wouldn't expect any datatype conversion issues.

    Perhaps... To know for sure check the query plan (the actual query plan, not...

    "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: Using Parameters in a Query is Killing Performance

    Sergiy (2/17/2016)


    Make the PK on UserID non-clustered and create a clustered index on UpdateDt.

    Unless UpdateDt is not unique. Then perhaps a clustered index on composite key consisting of UpdateDt and...

    "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: Query Substring and Uppercase

    Use the UPPER function.

    "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: CUBE question

    The SQL Server Analysis Services (SSAS) Tutorial[/url] on mssqltips aint bad as it uses adventureworks as an example which is available online for free. If you are serious, I strongly...

    "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: SELECT .. INTO to replace empty string or NULL value

    Did what I posted help?

    "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: SELECT .. INTO to replace empty string or NULL value

    Implicit conversion is treating your '' value as a zero and making the column a numeric column. When you query a numeric column:

    WHERE Column3 = ''

    is the same...

    "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: Similar trainings to SQL Saturday?

    Eric M Russell (2/17/2016)


    Local user group meetings offer a similar experience. Also, you can find tons of recorded presentations on sites like YouTube and SQLBits.

    +1

    There's so much good free...

    "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: Display numeric as empty string based on condition

    Luis Cazares (2/17/2016)


    You might want to reduce your varchar length. I've never heard of a common use for such large numbers.

    haha - I missed the comment about converting to varchar(100)....

    "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: Similar trainings to SQL Saturday?

    When Redgate SQL in the City comes around that's similar to SQL Saturday. I know this was not your question but it's worth mentioning.

    I don't know about the other...

    "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: Display numeric as empty string based on condition

    Here's two options:

    DECLARE @table TABLE (CashFlowCoverage int);

    INSERT @table VALUES (1),(2),(-999),(999);

    SELECT CashFlowCoverage = NULLIF(NULLIF(CashFlowCoverage,-999),999)

    FROM @table;

    SELECT CashFlowCoverage = NULLIF(ABS(CashFlowCoverage),999)

    FROM @table;

    EDIT: changed the column name

    "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 - 991 through 1,005 (of 2,462 total)