Forum Replies Created

Viewing 15 posts - 3,796 through 3,810 (of 8,731 total)

  • RE: select string between two ',' symbols

    This is similar to the option previously posted by Anthony using the DelimitedSplit8k.

    WITH CTE AS

    (

    SELECT *, MAX(ItemNumber) OVER(PARTITION BY hid) - 1 AS thisItem

    FROM #test

    CROSS APPLY dbo.DelimitedSplit8K (hid,',')

    )

    SELECT Item

    FROM...

  • RE: grouping time periods with gaps

    Just if anyone wants an example that is not as complex as the one from Drew (that problem required a more complex solution than this one).

    WITH CTE AS(

    ...

  • RE: summing alpha columns

    If you were working on a 2012+ version, you could use try_parse, try_convert or try_cast.

    Otherwise, you need to do it manually.

    SELECT *

    FROM tbl

    WHERE CASE WHEN Column1 NOT LIKE...

  • RE: JOIN in date range slow

    RVO (11/17/2015)


    Luis,

    So what is the solution

    for

    The estimated row counts are way off

    UPDATE STATISTICS ?

    That should correct that issue, unless is code related. You still have to work on that...

  • RE: JOIN in date range slow

    kaj (11/17/2015)


    You have a few places in your query where you apparently need trimming on join fields:

    UPPER(LTRIM(RTRIM(FIS2_Account_Shared.TD_LEGAL_ENTITY))) = UPPER(LTRIM(RTRIM(FIS2_Acct_Lgl_Ent.MNEMONIC)))

    OR UPPER(LTRIM(RTRIM(FIS2_Account_Shared.TD_LEGAL_ENTITY))) = UPPER('TD SECURITIES CANADA')

    In my limited experience...

  • RE: Are the posted questions getting worse?

    Ed Wagner (11/17/2015)


    Sean Lange (11/17/2015)


    Luis Cazares (11/17/2015)


    Lynn Pettis (11/17/2015)


    OMG

    Step 1: Prepare 3 envelopes. :hehe:

    ROFL.

    I thought step 3 was to prepare 3 envelopes.

    It's too late for that. Unless someone wants to...

  • RE: JOIN in date range slow

    RVO (11/17/2015)


    Luis,

    So what should I do about

    ". . . The estimated row counts are way off, but I'm not sure if they're like that from the non-equi joins.."

    If you...

  • RE: JOIN in date range slow

    RVO (11/17/2015)


    Hello Luis,

    "....No, I'm just saying that if it's a cross join, you should write it as such..."

    Do you mean you would lie to see

    SELECT .....

    FROM

    a

    CROSS JOIN

    b

    style ?

    Yes, it's...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (11/17/2015)


    OMG

    Step 1: Prepare 3 envelopes. :hehe:

  • RE: t-sql 2012 passing lot of values in a parameter

    SoHelpMeCodd (11/17/2015)


    Passing a delimited string certainly works. But I am currently working an issue where one sproc uses STUFF FOR XML to create a delimited string. A second sproc accepts...

  • RE: Are the posted questions getting worse?

    ChrisM@Work (11/17/2015)


    From some time yesterday through to the present I've been noticing something a little odd. In the workplace, on the commute home last night (the walk, the tube, the...

  • RE: Using Lile and OR in a WHERE clause

    Phil Parkin (11/16/2015)


    There was a problem with your final LIKE. '%%' does not mean anything more than '%', which in turn means anything or nothing.

    Anything or nothing that is not...

  • RE: Shrinking Database

    Empty space in data files won't hurt performance, unless the disk is full and that prevents OS operations. Growing a file is expensive, so you must plan to leave free...

  • RE: Using Lile and OR in a WHERE clause

    If I understand correctly, you want something like this:

    SELECT DISTINCT ProjectName AS Project

    FROM Timesheet

    WHERE (@ProjectType = 'P25, R&D' AND (ProjectName LIKE '2%' OR

    ...

  • RE: Today's Random Word!

    DonlSimpson (11/16/2015)


    Ed Wagner (11/16/2015)


    anthony.green (11/16/2015)


    djj (11/16/2015)


    anthony.green (11/16/2015)


    Ed Wagner (11/16/2015)


    Sith

    Dark

    Chocolate

    Bean

    Coffee

    Java

    Jabba

Viewing 15 posts - 3,796 through 3,810 (of 8,731 total)