Forum Replies Created

Viewing 15 posts - 1,456 through 1,470 (of 7,619 total)

  • Reply To: UNION, JOIN?

    Assuming you don't want to return the second if the first gets a match -- you never really stated exactly -- then do this:

    SELECT mt.BusinessUnit, mt.PartNum, mt.WONum, mt.TransDate, mt.TransQty, ISNULL(ot1.WOQty,...

    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: UNION, JOIN?

    So my response did not help you at all?

    If you need to return data from the non-main tables conditionally, based on whether the WONum appears in each table 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: Multiple deadlocks occuring on simultaneous deletions from temporal table

    Jeff Moden wrote:

    ScottPletcher wrote:

    zoggling wrote:

    DELETE FROM dbo.Table WHERE ID IN (12); ... With the temporal table, deadlocks are guaranteed every time. Only one of the deletions will succeed; the rest...

    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: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ????

    But note that you can get phantom reads and nonrepeatable reads in the default READ COMMITTED mode as well.

    And that the majority of issues with NOLOCK are caused by 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".

  • Reply To: Shrinking Lob Data

    Sadly, on 2014, you don't have the COMPRESS function available to help you out.  But when you upgrade to 2016 (or later), be sure to look into that.

    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: Shrinking Lob Data

    (1) No, they are not the same.  SQL will move non-LOB data to out of row storage if otherwise a row cannot fit onto its 8K page.  For example, if...

    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: UNION, JOIN?

    Based on the limited info we have so far, the JOINs would look something like this:

    SELECT *
    FROM dbo.main_table mt
    LEFT OUTER JOIN dbo.other_table1 ot1 ON ot1.WOQty = mt.WONum
    LEFT...

    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: Multiple deadlocks occuring on simultaneous deletions from temporal table

    zoggling wrote:

    DELETE FROM dbo.Table WHERE ID IN (12);

    ...

    With the temporal table, deadlocks are guaranteed every time. Only one of the deletions will succeed; the rest will fail.

    We have tried ......

    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: Index suggestions question

    oRBIT wrote:

    Many index-suggestions I get from the database I'm working on, very often suggests quite alot of include-columns. Could this be a sign of poor database-design?  As far as I...

    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: (Newbie) Help with strange tables in my database "dbo.183" etc.

    No idea.  They're not system tables that are intrinsic to MS.  Some other user/3rd party code/script must be creating them.

    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: column count per table best practice

    Jeff Moden wrote:

    ScottPletcher wrote:

    Again, you haven't ever done an actual logical design, have you?  Genuine data modeling, with no indexes, etc.., where you went through a true normalization process.

    Heh... more...

    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: column count per table best practice

    Jeff Moden wrote:

    BWAAAA-HAAAA-HAAAA!!!  Ok... I "get it".  Yep... I agree... you never have to mention "IDENTITY" in a logical model.  I have to tell you, though, that the idea of having...

    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:

    But, IIRC, the default trace does not record what id specifically made the change if that id has certain levels of permission.  I think if you want to know 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".

  • Reply To:

    A DDL trigger should be enough, including putting in place things to monitor it, to make sure no one has modified that trigger.

    In a business environment, no one should be...

    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: Error 17311 while trying to run query with OPENDATASOURCE

    As a first step, make sure you are on the latest CU patch level.

    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 - 1,456 through 1,470 (of 7,619 total)