Forum Replies Created

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

  • RE: Asynchronous Cursor Population Slow for Large Result Sets

    I don't think SQL is using async processing for that specific cursor, based on this information from Books Online:

    "

    SQL Server does not support generating keyset-driven or static Transact-SQL cursors asynchronously....

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Help with Totals per half hour timeframe

    drew.allen (7/6/2015)


    You were actually very close. The problem is here.

    order by ABS (DateAdd(Minute, 30 * (DateDiff(Minute, 0, closedate) / 30), 0)) ASC

    DATEADD() returns a date/time and ABS() takes a...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Turning datediff minutes into dd:hh:mm

    select c.APPLICANT_ID as [Applicant ID], aetc.EVENT_TYPE as [Event Type],

    cast(aetr.CREATE_DATE as date) as [Registration Date],

    cast(aetc.CREATE_DATE as date) as [C Creation Date],

    right('0' + cast(minutes_diff / 1440 as varchar(2)), 2)...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: what's the best practice to count distinct?

    Edit: changed these comments:

    Most important is to change the WHERE to not use functions on the table column.

    You should also very strongly analyze clustering the table by INSERT_DETECT_TS (add Incident_Id...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: How show only first friday of every month

    Here's a completely setting-independent way to calc only Fridays; it's actually a straight-forward task. Note: Since my software at work blocks CTEs (as some type of "injection"), I had...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: How to validate a trigger in SQL Server

    Again, check this DMV:

    sys.sql_expression_dependencies

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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