Forum Replies Created

Viewing 15 posts - 3,481 through 3,495 (of 4,087 total)

  • RE: Issue with multi selection option in dropdown list

    Duplicate post. Please post responses here: http://www.sqlservercentral.com/Forums/Topic1207598-392-1.aspx

    Please don't cross-post. It fragments the discussion.

    Drew

  • RE: Pivot table query - making it dynamic

    terryshamir (11/17/2011)


    The reporting software is Excel. the people using do not have the skills (neither do I or do I want to learn) to do a pivot table but most...

  • RE: concate date and time field

    Cadavre (11/17/2011)


    PRINT '========== Alternative=========='

    SELECT @Holder = randomDate + randomTime

    FROM #testEnvironment

    PRINT '========== Alternative 2=========='

    SELECT @Holder = DATEADD(SECOND, DATEDIFF(SECOND, 0, randomTime), randomDate)

    FROM #testEnvironment

    PRINT '========== Alternative 3=========='

    SELECT @Holder = DATEADD(d, DATEDIFF(d, randomTime, randomDate),...

  • RE: Pivot table query - making it dynamic

    You're probably better off leaving the pivot to your reporting software. You don't provide enough details to say for sure.

    Drew

  • RE: concate date and time field

    It has been repeatedly shown that manipulating dates by converting back and forth between character data performs very poorly versus using the datetime functions. The following code will always...

  • RE: Query xml column

    The .value() function requires a singleton, and you may not have specified the singleton correctly.

    Drew

  • RE: How to disable output of crusors

    ahmed_b72 (11/16/2011)


    Is there a way to avoid displaying every row returned from the cursor?

    The best way is to avoid using a cursor in the first place. They perform horribly...

  • RE: Cursor Variable in EXEC Statement

    CELKO (11/16/2011)


    SQL is declarative, so we do this stuff in the DDL, not in fake mag tapes. The number of suffixes is constant and short, so put it in a...

  • RE: Query xml column

    You're most of the way there. This should give you what you want. The vast majority of the time, you'll probably want to use relative paths for everything...

  • RE: Concatenate All Duplicate Values

    Your data doesn't have enough information to fully specify the order, so the order is not completely guaranteed. For example 17 could easily render as "Riding on big horses...

  • RE: Cursor Variable in EXEC Statement

    MattieNH (11/16/2011)


    I have a table of valid suffixes that I want to loop through (yes, a cursor).

    You really don't. There is nothing in your query that indicates that a...

  • RE: Can't figure out why the following T-SQL script doesn't work...

    John Mitchell-245523 (11/16/2011)


    That UPDATE statement won't loop through the rows in @Dept - it will use the first row in @Depts that it finds and then stop.

    Actually, as Jeff Moden...

  • RE: calculating a median for groups

    A good rule of thumb to use is that you should not use code that you find on the Internet unless you understand what it is doing. If a...

  • RE: IF versus CASE statements

    Lowell (11/15/2011)


    your example is bending an IF into a situation similar to a CASE, but an IF statement can do much more than that.

    I would argue that he's doing the...

  • RE: add bold in for xml type

    It's because your '<B>' is text, not xml. The easiest way is to use the following:

    select

    = convert(varchar(3), t.num),'',

    ...

Viewing 15 posts - 3,481 through 3,495 (of 4,087 total)