Forum Replies Created

Viewing 15 posts - 2,821 through 2,835 (of 7,619 total)

  • Reply To: DML performance : Unpartioned Table with Index vs Partitioned table with Index

    The biggest advantage to me of partitioning is being able to do separate compression, reorg, etc., on each partition.

    But, I too did have some cases where partition elimination has made...

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

  • Reply To: Converting Substring to DateTime - extra eyes please

    If possible, put the full details in the "Description" in the backup file.  That way it's always automatically/inherently available with the backup.  The description can be retrieved prior to an...

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

  • Reply To: Question on seting a default on a table column

    I'm dating myself here, but:

    Bill or George! Anything but Sue!

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

  • Reply To: Question on seting a default on a table column

    Oops, I left out one important line, to prevent run-away trigger recursion.  In this case the UPDATE itself would prevent recursion, but it's safer to always check, in case other...

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

  • Reply To: Question on seting a default on a table column

    Typically you'd use an AFTER trigger to correct the data.  If you wanted to, you could also have the trigger verify whether the value is a valid date or not.

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

  • Reply To: Capture SQL jobs running longer than x minutes

    Here's a sample query that finds jobs that run a certain % of time over previous runs.  Naturally you can tweak the percentages and prior run counts as you prefer...

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

  • Reply To: Space used by Primary Key Constraint (Index) vs Data space used by table itself

    A clustered index is the table itself.  The PK may or may not be clustered.

    So, technically speaking, "index space" in your context would mean non-clustered indexes, which may or may...

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

  • Reply To: Subtarcting seconds from a time

    Oops.  I didn't subtract from the final result:

    (case when [Duration]<'00:52' then '00:00' else DATEADD(SECOND, -52, [Duration]) end)

     

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

  • Reply To: SQL Date calculation

    30 days was a placeholder as much as anything else.  The logic can be as simple or as complex as needed to properly translate the Duration text.  The main idea...

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

  • Reply To: SQL Date calculation

    You should add a column to contain the duration in days.  Compute the value once when a row is inserted or deleted (using a trigger).  You don't want to have...

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

  • Reply To: How to subtract time

    If I understand the desired logic correctly, then this:

    alter table [DMPCRU].[dbo].[VaspianCalls] add [Hold_Time] as (iif(Duration < '00:52', '00:00', Duration))

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

  • Reply To: Delete is very slow

    Look at the query plan.  Is SQL able to do seeks to find the 1000 rows or does it have to scan the whole table first?

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

  • Reply To: On using Tablediff.exe utility in SQL Server

    I thought there were settings for source and destination schema.  It defaults to dbo, but afaik, the two schemas do not have to be the same.

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

  • Reply To: top 5 cpu consumers and collecting the result set in table

    MS has a built-in standard report for Top 10 Avg or Total CPU queries, but that is a point-and-click, and I don't know of any way to store the results.

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

  • Reply To: combination of values

    If you don't genuinely need RowNum and TotalRowNum, drop them.

    If you do, you can pre-compute RowNum in the X1 table, and compute the TotalRowNum based on the pre-computed RowNums 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".

Viewing 15 posts - 2,821 through 2,835 (of 7,619 total)