Forum Replies Created

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

  • RE: How to find if a database has been access/used since last month.

    There's no really good way to do that because it's so difficult. A db could be referenced by a linked server or by a 3-part name contained in dynamic...

  • RE: Self Join alternative

    Yeah, you could do that, but it's rather bizarre. What would the day before's activities have to do with today?

  • RE: How to validate a trigger in SQL Server

    Again, check this DMV:

    sys.sql_expression_dependencies

  • RE: How to validate a trigger in SQL Server

    A table that doesn't exist is a different issue, because SQL's deferred name resolution allows that, but not invalid/missing column names.

    The other thing to try would be dmv:

    sys.sql_expression_dependencies

  • 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...

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