Forum Replies Created

Viewing 15 posts - 3,346 through 3,360 (of 7,619 total)

  • RE: Wht is the best way to load 15 million rows into a table with a pk? There are known duplicates.

    The "standard" way to do that is to make sure the key doesn't already exist in the table to be insert to.  If you need to, delete dups from the...

    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: Breaking up huge audit table (1.1B rows) into smaller tables

    The table's already clustered by [TRANSACTION_TIME].  That's fantastic, it'll make your job so much easier.  We'll just want to increase the fill factor from 90 to 99 for the historical...

    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: Breaking up huge audit table (1.1B rows) into smaller tables

    Need to see the definitions of indexes too, especially for the clustered index (or pk, as that will be the clustering key unless you explicitly say it isn't).

    You...

    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: Breaking up huge audit table (1.1B rows) into smaller tables

    Is(are) there any index(es) at all on this table?  If not, you'll definitely want to "create a brand new table to insert into while the old table data is being...

    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: Breaking up huge audit table (1.1B rows) into smaller tables

    What you've stated and shown is contradictory.  Is transaction_time a "string", as you stated, or a datetime, as your code shows?

    Assuming it's a datetime, you don't really need...

    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 get and use the value returned by SP to a INSERT INTO... SELECT... statement

    Below is a re-coded version of the stored proc.  It does the UPDATE of IsUsed inline, to reduce (eliminate?) chances of two near-same-time execs of it getting the same NextID...

    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: Performance tuning a transaction

    1) How is clustered?  By ( Col, Col1) or something else?

    2) How is normally searched?  By ( Col, Col1 ) or by something else?

    3)...

    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: create table from select

    Luis Cazares - Monday, June 4, 2018 1:01 PM

    ScottPletcher - Monday, June 4, 2018 12:26 PM

    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: Wht is the best way to load 15 million rows into a table with a pk? There are known duplicates.


    INSERT INTO dbo.exportLogTable
    SELECT
      ...list_of_all_columns_in_table...
    FROM (
      SELECT *, ROW_NUMBER() OVER(PARTITION BY tableID ORDER BY tableID) AS row_num
      FROM dbo.exportLogTable2
    ) AS elt2

    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: create table from select

    SELECT * INTO Title2 FROM Title;

    Not a good idea.  A direct SELECT ... INTO new_table can cause system table locking and can cause concurrence issues.  You should...

    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: GUIDs as clustered index

    To the OP:
    I still wish you'd run the script I posted earlier and post the results (on Page 4; can't get the link to it to copy correctly right...

    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: GUIDs as clustered index

    Jeff Moden - Saturday, June 2, 2018 4:54 PM

    Sergiy - Friday, June 1, 2018 6:27 PM

    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: Same stored procedure 5 times vs 5 different procedures

    You want five separate stored procs regardless.  Then, if you want only to have to call 1 main proc from the report/SSRS/whatever, create a parent/"driver" proc that executes those 5...

    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: GUIDs as clustered index

    For [AMT].[ItemVersions] :
    If [Description] and [PropertyBag] are (1) used more than rarely *and* (2) are used in at least 1 time-critical task *and* (3) for a majority of rows,...

    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: GUIDs as clustered index

    Definitely need index overhauls.  [And wow do you all love guids!]  Would you mind running the script below and posting the results?  I always prefer to tune including actual SQL...

    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 - 3,346 through 3,360 (of 7,619 total)