Forum Replies Created

Viewing 15 posts - 6,661 through 6,675 (of 7,619 total)

  • RE: Why is "instead of delete" trigger not fired by delete inside "after update" trigger

    brettstahlman (3/18/2013)


    Lynn Pettis (3/16/2013)


    brettstahlman (3/16/2013)


    Lynn Pettis (3/16/2013)


    brettstahlman (3/16/2013)


    opc.three (3/16/2013)


    The reason why I disagree is because of the behavior of the after trigger when it is the instead trigger that is...

    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: Alter numeric(12,6) to numeric(19,4) - is it metadata only or is it recreate table?

    Could you go to NUMERIC(19,6)? That should work fine, and I think it will be just a metadata change.

    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: Database name is visible but not available.

    This is off the wall, but did "AUTO_CLOSE" somehow get set on for that db?

    That's a longshot, since even if it did it should auto_open when you reference it, but...

    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: Setting rowcount also limits the available databases in the database drop down...

    Interesting.

    SSMS is probably internally running a query / stored proc to get the list of databases. Obviously the "SET ROWCOUNT" is affecting the code it uses as well.

    I guess...

    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: Why is CDC returning Insert/Delete when I UPDATE a row in a table?

    For certain UPDATE statements, SQL must instead actually do a DELETE and an INSERT instead of an UPDATE. So, the result is normal for SQL.

    If you need to see...

    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 combine and convert two integer columns to datetime

    Or, another possibility (with no character conversions/manipulation):

    SELECT

    ColA, ColB,

    DATEADD(SECOND, ColB % 100, DATEADD(MINUTE, ColB % 10000 / 100, DATEADD(HOUR, ColB /...

    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: Query to find cheapest supplier when multiple suppliers?

    I thought my query might meet the stated requirement while knocking out the second table scan :-).

    If OP does need to list the alternate supplier(s), then yes, I think some...

    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: Query to find cheapest supplier when multiple suppliers?

    Poor HAVING, nobody likes him 🙂

    SELECT

    ProductID, BaseSupplierID,

    MIN(CASE WHEN SupplierID <> BaseSupplierID THEN Price END) AS LowestPrice,

    MIN(CASE WHEN SupplierID...

    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: adding a new not null bit column with default 0

    You could also make the "real" column name a computed column that the developers use, and based off a "dummy name" column so they don't have to deal with NULLs....

    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: adding a new not null bit column with default 0

    Can you just add the column with no default value, for now, and handle the NULLs in the code temporarily?

    It's almost certainly applying the default value that is taking 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: maximum rows without duplication

    select

    a.a, a.b, a.c

    from @a a

    left outer join (

    select b

    from @a a2

    group by b

    ...

    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 query 4 weeks 3 business days

    David Mando (3/11/2013)


    Thanks so much for your quick response.

    How would I write this query if it is just (- 4 weeks and 3 days)?

    select dateadd(day, -3, dateadd(week,-4,getdate()));

    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: Is this is the Best Practice to select E: for the SQL Server root directory?

    Sqlism (3/11/2013)


    Hi Experts,

    Is this is the Best Practice to select E: for the SQL Server root directory? Please let me know the Pros/cons and the practices to be followed.

    Thanks 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: maximum rows without duplication

    Maybe code below will do what you need.

    I haven't tried for efficiency, just to get the result you want.

    select

    a.a, a.b, a.c

    from @a a

    left outer join (

    ...

    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 update same record that fires trigger?

    opc.three (3/8/2013)


    btio_3000 (3/8/2013)


    But wouldn't it create a recursive call on that trigger? Updating the same table that the UPDATE trigger is defined on?

    Thank you

    No, not unless RECURSIVE_TRIGGERS is ON. 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 - 6,661 through 6,675 (of 7,619 total)