Forum Replies Created

Viewing 15 posts - 376 through 390 (of 2,462 total)

  • RE: Need to implement left join using look up

    My experience has been that this is faster and easier using plain ol' T-SQL. Why not just create a script task and use the query that you queries 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: Need help with a SQL "least significant digit" algorithm

    Phil's solution is brilliant (this was a tricky problem that I could not solve).

    Based on what you said - 4.0 should be 4.1 but if you want 4.0 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: How to use a CSV as parameter in a query

    If you can't add a new UDF you can just apply the logic to a SQL query like so:

    DECLARE

    @pString VARCHAR(8000) = '11,15,200',

    @pDelimiter CHAR(1)...

    "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 use a CSV as parameter in a query

    (expanding on what Phil said...)

    You need a "splitter" function - the one Phil posted a link to is the best one for the job. This query:

    DECLARE @param varchar(1000) = '1,2';

    SELECT...

    "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: Talking baseball

    Removed (posted twice somehow)

    "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: Talking baseball

    We dyed the Chicago River Cubs blue.

    "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: Split Record by Field into Multiple Records

    Another way (building off Drew and Kevin's excellent solutions) would be like this:

    WITH iTally(n) AS

    (

    SELECT n

    FROM ( VALUES(1), (2), (3), (4), (5), (6), (7), (8),...

    "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: SSIS Package documentor

    I missed the article the first time around but just read it.

    The fact that SSIS packages are XML files makes documenting SSIS so much easier provided you have 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: Help on Hierarchy Query

    Luis Cazares (11/2/2016)


    Why do you even need a derived table?

    SELECT

    meetingID,

    ProviderName,

    SubGroupName,

    SessionName,

    ...

    "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: WITH INDEX hint

    I use query hints from time-to-time (not too often) but only when there is no doubt that it's the right choice. The conventional wisdom seems to be that, if 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: Help on Hierarchy Query

    thomashohner (11/2/2016)


    I think i figured it out. Ugly SQL but it seems to work.

    Thanks

    --Meeting, Subgroup, Session

    CREATE TABLE #Table (MeetingID INT , Levels VARCHAR(20), ProviderName VARCHAR(20), PatientName VARCHAR(20), SubGroupName VARCHAR(20),SessionName...

    "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: Talking baseball

    jasona.work (11/2/2016)


    So, any bets on how much of Chicago will be left standing after tonight, if the Cubs win (or lose?)

    I'm thinking something along the lines of when the Detroit...

    "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: Easy way to search for a string any where within XML column?

    This is an interesting 5-year old thread...

    Something interesting to note is that the default output for the SQLXML value method is all child text. With that in mind, this...

    "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: Talking baseball

    Markus (11/2/2016)


    This last game could go either way... I was looking this morning and both teams have scored 19 runs each in these 6 games.

    Kluber is their best...

    "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: Today's Random Word!

    djj (11/1/2016)


    Luis Cazares (11/1/2016)


    Ray K (11/1/2016)


    Resistance

    Rebellion

    Jedi

    academy

    "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 - 376 through 390 (of 2,462 total)