Forum Replies Created

Viewing 15 posts - 976 through 990 (of 2,463 total)

  • RE: Odd (to me) Behavior with NTILE() and NULL Values in Source Data

    Just a quick update:

    I have a good solution that I'm still testing (note my earlier comment). It has taken me longer than expected. I'll try to post it in the...

    "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: Odd (to me) Behavior with NTILE() and NULL Values in Source Data

    EdgeOfKnowWare (2/23/2016)


    Rich Mechaber (2/23/2016)


    Hi, Alan, o/p here, and I've enjoyed the follow-on conversation I started.

    This aspect of NTILE() is an eye-opening piece of information, thank you for posting...

    "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: Are the posted questions getting worse?

    I don't know if anyone is aware of this but I noticed Dwain Camps hadn't posted anything in awhile so I checked his blog (dwaincsql.com), simple-talk, twitter, linkedin... then came...

    "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: Odd (to me) Behavior with NTILE() and NULL Values in Source Data

    So, to dig even further...

    SSC is the right place 😉

    If your table had 92 million records, and you had 9 different "Val" columns, would you still use the same code?...

    "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: xml column from table

    Note my code and comments.

    USE tempdb

    GO

    -- Create a table with an XML column

    IF OBJECT_ID('tempdb.dbo.YourTable') IS NOT NULL DROP TABLE dbo.YourTable;

    CREATE TABLE dbo.YourTable(SomeID int identity primary key, SomeXML xml 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: A Lightweight, Self-adjusting, Baseline-less Data Monitor

    Excellent article, well written and an easy read. I need to look at/play around with your code a little more to understand what you're doing but I love the overall...

    "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: Odd (to me) Behavior with NTILE() and NULL Values in Source Data

    EdgeOfKnowWare (2/22/2016)


    Alan, I agree with you, if you're just wanting one ranking. If we expand upon the Original Posters issue (which is what I was facing) and say that you...

    "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: Returning unique row from multiple in a table variable

    jim.snyder (2/22/2016)


    Thanks, Alan. This is hospital data and I am bound by HIPAA and PMI to not give account numbers or personal information out. I understand (went to the link...

    "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: Odd (to me) Behavior with NTILE() and NULL Values in Source Data

    EdgeOfKnowWare (2/22/2016)


    No, that's not quite what I was trying to do.

    The problem I had (which lead me to this post via Google) was that I had several different rankings dependent...

    "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: Multi-valued Parameter Query issue

    Glad to help.

    <hits forehead with palm of hand!!>

    Me too. So much so that I now have a receding hairline :hehe:

    "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: Are the posted questions getting worse?

    Phil Parkin (2/22/2016)


    Alan.B (2/22/2016)


    Ed Wagner (2/22/2016)


    Luis Cazares (2/19/2016)


    Ed Wagner (2/19/2016)


    GilaMonster (2/19/2016)


    SQLRNNR (2/18/2016)


    I am seeing people claim to be an MCM for some of these interviews. I know full well they...

    "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: Returning unique row from multiple in a table variable

    jim.snyder (2/22/2016)


    I am building a process where I have a few places that have multiple rows with the same (non-unique) key. In one area, I can use the field that...

    "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: Odd (to me) Behavior with NTILE() and NULL Values in Source Data

    EdgeOfKnowWare (2/22/2016)


    Maybe a work around would be something like this:

    SELECT *,

    CASE WHEN val IS NULL THEN 0 ELSE 1 END,

    NTILE(4) OVER (PARTITION BY CASE WHEN val IS NULL THEN 0...

    "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: Multi-valued Parameter Query issue

    I am very confused since I am not delimiting a string

    If you are using multi-select in SSRS then SSRS is passing a comma-delimited string to your query or stored proc....

    "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: Are the posted questions getting worse?

    Ed Wagner (2/22/2016)


    Luis Cazares (2/19/2016)


    Ed Wagner (2/19/2016)


    GilaMonster (2/19/2016)


    SQLRNNR (2/18/2016)


    I am seeing people claim to be an MCM for some of these interviews. I know full well they aren't an MCM....

    "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 - 976 through 990 (of 2,463 total)