Forum Replies Created

Viewing 15 posts - 4,996 through 5,010 (of 7,610 total)

  • RE: Self Join alternative

    Here's a quick cross-tab example specific to your situation:

    SELECT D.PersonID,

    MAX(CASE WHEN D.Activity = 'Woke Up' THEN D.ActivityTime END) AS WakeUpTime,

    MAX(CASE WHEN D.Activity...

  • RE: how to make sproc return errors for underlying table errors

    You didn't get an error because a bit column will treat any value greater than 1 as 1, so SQL converted the "2" to a 1.

  • RE: How to validate a trigger in SQL Server

    Try running:

    sp_refreshsqlmodule or

    sp_refreshview

    on potentially affected objects.

    You should get errors on the object(s) that now reference unknown columns.

  • RE: How to make actual execution plan better?

    Jeff Moden (6/30/2015)


    GilaMonster (6/30/2015)


    Jeff Moden (6/30/2015)


    It seems like a lot of folks don't understand that a non-clustered index is a duplication of data that not only affects queries and space...

  • RE: free tempdb

    You can add a file to tempdb if you need to. Or explicitly expand an existing file(s) yourself.

    Be extremely careful if/when trying to modify, or drop, existing objects in...

  • RE: need help on Scalar value Function

    Sean Lange (6/30/2015)


    Jacob Wilkins (6/30/2015)


    This is all rather interesting, so I thought I'd chime in.

    Based on what I've tested, Scott is technically correct. Under the right conditions, even where it...

  • RE: Query help - pulling daily total from cumulative total

    You'll probably need to use ROW_NUMBER() for now:

    ;WITH CTE_sales AS (

    SELECT

    date_created, sales,

    ...

  • RE: need help on Scalar value Function

    Jeff Moden (6/26/2015)


    ScottPletcher (6/26/2015)


    Sean Lange (6/26/2015)


    ScottPletcher (6/25/2015)


    GilaMonster (6/25/2015)


    Nolock hints, do you know what they do? (hint, they don't make queries faster)

    Why does everyone keep repeating that?

    Scott you have been...

  • RE: need help on Scalar value Function

    Sean Lange (6/26/2015)


    ScottPletcher (6/25/2015)


    GilaMonster (6/25/2015)


    Nolock hints, do you know what they do? (hint, they don't make queries faster)

    Why does everyone keep repeating that?

    Scott you have been around sql long...

  • RE: need help on Scalar value Function

    Jeff Moden (6/25/2015)


    ScottPletcher (6/25/2015)


    sgmunson (6/25/2015)


    ScottPletcher (6/25/2015)


    GilaMonster (6/25/2015)


    Nolock hints, do you know what they do? (hint, they don't make queries faster)

    Why does everyone keep repeating that? Of course NOLOCK hints...

  • RE: need help on Scalar value Function

    sgmunson (6/25/2015)


    ScottPletcher (6/25/2015)


    GilaMonster (6/25/2015)


    Nolock hints, do you know what they do? (hint, they don't make queries faster)

    Why does everyone keep repeating that? Of course NOLOCK hints make queries run...

  • RE: query about nulls

    sgmunson (6/25/2015)


    ScottPletcher (6/25/2015)


    I prefer this approach [Edit: Because of its clarity, and to avoid using functions in the WHERE clause, which should be avoided whenever (reasonably) possible]:

    WHERE

    ...

  • RE: query about nulls

    I prefer this approach [Edit: Because of its clarity, and to avoid using functions in the WHERE clause, which should be avoided whenever (reasonably) possible]:

    WHERE

    (requirementGradYear...

  • RE: need help on Scalar value Function

    GilaMonster (6/25/2015)


    Nolock hints, do you know what they do? (hint, they don't make queries faster)

    Why does everyone keep repeating that? Of course NOLOCK hints make queries run faster, even...

  • RE: Create table help?

    Select [C1] ,

    [C2] ,

    DATEADD(S, C3, '1970-01-01 00:00:00') AS [C3] ,

    [C4] ,

    [C5] ,

    [C6] ,

    [C7] ,

    [C8] ,

    [C112],

    [C675001003] ,

    [C812000101] ,

    [C875000000] ,

    [C875000001],

    [C875000002] ,

    [C875000003] ,

    [C875000004] ,

    [C875156000] ,

    [C875156001] ,

    [C875156002] ,

    [C875156005] ,

    [C875156006] ,

    [C875156007] ,

    [C875156003] ,

    [C875156004]...

Viewing 15 posts - 4,996 through 5,010 (of 7,610 total)