Forum Replies Created

Viewing 15 posts - 6,676 through 6,690 (of 7,613 total)

  • RE: Hidden Tricks To SQL Server Table Cleanup

    SAinCA (3/6/2013)


    Please, if you're on SQL2005, watch out that you have sufficient TEMPDB space to accommodate all those deleted rows.

    When a row is deleted, it is stored in TEMPDB as,...

    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: Hidden Tricks To SQL Server Table Cleanup

    Edward.Polley 76944 (3/6/2013)


    Agreed the count method consumes resources so initially against huge tables I hard code the count. Say the table has 50 million rows to remove, no point...

    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: Formatting issue in SQL

    sqlnaive (3/6/2013)


    Yuvipoy/Lynn,

    I agree with both of you. Infact i'm checking my code that way only. However my concern is if SQL is giving such an efficient way of checking 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: Hidden Tricks To SQL Server Table Cleanup

    Like some others here, I'm not in favor of the "count" method of doing these DELETEs. In particular, if the process has to be stopped and then resumed later,...

    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: DB Normalisation Help required

    Below is a start. Please don't skimp on the design phase, it will bite you later. Foreign key relationships are indicated by matching column names.

    Be prepared, though: when...

    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 write a column expression in a query based on other table value exist

    Or you can use EXISTS:

    SELECT

    sno, sname, address,

    CASE

    WHEN EXISTS(SELECT 1 FROM dbo.StudentDrillEnrolled sde WHERE sde.sno...

    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: Formatting issue in SQL

    Check out OBJECT_DEFINITION(). That returns a single nvarchar(MAX) that is the whole procedure, rather than 255 characters per row (artificial "line"?) that sp_helptext seems to do.

    I find it useful...

    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: convert 2000 db to 2008 r2 db

    In SQL 2008, if you want a specific user to be able to execute any stored proc (existing ones and newly created ones), you can do this:

    USE <your_db_name>

    GRANT EXECUTE TO...

    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: Select full month number (with 0)

    Lynn Pettis (3/5/2013)


    ScottPletcher (3/5/2013)


    Lynn Pettis (3/5/2013)


    ScottPletcher (3/5/2013)


    Jeff Moden (3/4/2013)


    I'd love to take the credit for it but it's not my code. It's Scotts (although I'd have done it 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: SQL 2008 enterprise to standard degradation

    There's no physical db differences from Enterprise to Std, so if the SQL version numbers are the same, you should be able to restore all dbs, including system dbs, from...

    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: Select full month number (with 0)

    Lynn Pettis (3/5/2013)


    ScottPletcher (3/5/2013)


    Jeff Moden (3/4/2013)


    I'd love to take the credit for it but it's not my code. It's Scotts (although I'd have done it the same way).

    I was...

    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: Select full month number (with 0)

    Jeff Moden (3/4/2013)


    I'd love to take the credit for it but it's not my code. It's Scotts (although I'd have done it the same way).

    I was just curious as...

    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: Including additional columns in a unique clustered index

    GilaMonster (3/4/2013)


    ScottPletcher (3/4/2013)


    Again, rigid overly-simplistic rules such as those will give you a poorly performing database with excessive nonclustered indexes to cover all the queries the clus index can't because...

    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: Select full month number (with 0)

    Jeff Moden (3/4/2013)


    @scott,

    I'm not so sure why you insist on using codes for literal dates, but I prefer not to.

    Where in the world did I suggest using a format code...

    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: Including additional columns in a unique clustered index

    Uniqueness should not be the primary consideration for a clus key. Uniqueness should be a factor, but it's not the most important factor. The proper clus key depends...

    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 - 6,676 through 6,690 (of 7,613 total)