Forum Replies Created

Viewing 15 posts - 4,216 through 4,230 (of 7,619 total)

  • RE: Need query for After Trigger on update,delete

    Even so, it's likely that for in-house audits, or less formal audits, the current table could be freely accessed, and then INSERTs might not need logged. But verify 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".

  • RE: Need query for After Trigger on update,delete

    Ed Wagner (8/16/2016)


    ScottPletcher (8/16/2016)


    Ed Wagner (8/16/2016)


    ScottPletcher (8/16/2016)


    Jeff Moden (8/15/2016)


    ScottPletcher (8/15/2016)


    Jeff Moden (8/15/2016)


    ScottPletcher (8/15/2016)


    Jeff Moden (8/15/2016)


    Also, you should probably avoid auditing inserts. It's an unnecessary duplication of data because even...

    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: Need query for After Trigger on update,delete

    Ed Wagner (8/16/2016)


    ScottPletcher (8/16/2016)


    Jeff Moden (8/15/2016)


    ScottPletcher (8/15/2016)


    Jeff Moden (8/15/2016)


    ScottPletcher (8/15/2016)


    Jeff Moden (8/15/2016)


    Also, you should probably avoid auditing inserts. It's an unnecessary duplication of data because even if there's never...

    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: Need query for After Trigger on update,delete

    Jeff Moden (8/15/2016)


    ScottPletcher (8/15/2016)


    Jeff Moden (8/15/2016)


    ScottPletcher (8/15/2016)


    Jeff Moden (8/15/2016)


    Also, you should probably avoid auditing inserts. It's an unnecessary duplication of data because even if there's never an update, 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: Need query for After Trigger on update,delete

    Jeff Moden (8/15/2016)


    ScottPletcher (8/15/2016)


    Jeff Moden (8/15/2016)


    Also, you should probably avoid auditing inserts. It's an unnecessary duplication of data because even if there's never an update, the original data lives...

    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: Finding data that does not exist in another table

    DECLARE @user-id nchar(10)

    SET @user-id = '001'

    SELECT @user-id AS UserID, p.*, 'Prods This User Hasn''t Purchased' AS Message

    FROM Prod_T p

    LEFT OUTER JOIN User_Prod_T up ON up.UserID = @user-id AND up.ProdID =...

    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: Need query for After Trigger on update,delete

    Jeff Moden (8/15/2016)


    Also, you should probably avoid auditing inserts. It's an unnecessary duplication of data because even if there's never an update, the original data lives in the original...

    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: Additional table in statement with OUTER APPLY

    I don't see any reason to conflate the last run with the next run. Also, when you query job activity, you need to include the session_id to make sure...

    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: explain composite index structure and work? How B Tree for composite index work internally?

    koteravindra (8/8/2016)


    HI,

    suppose if I have 3 columns in index with index order as ASC .

    Emplid,deptid,Accountid

    10 2 ...

    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: joining multiple tables without a join

    skippyV (8/5/2016)

    All these fields are nvarchar(50).

    So they're not nvarchar(50) but nvarchar(max)? Yeah, that's a totally different thing. Again, can't imagine why you'd ever need unicode there, let alone "max"!!

    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: Varchar to money\decimal

    Since you don't have quotes around the assigned value, the +000000007000 is first being converted to an int value, and then that value is converted to varchar(10). Naturally your actual...

    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: joining multiple tables without a join

    Again, there should be no issue at all indexing on an nvarchar column (although I can't imagine why you'd actually need unicode for that type of data).

    Can you post 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: Varchar to money\decimal

    There are no decimal places in the value: SQL can't possibly know to "adjust" for 2 decimal places from a varchar value. Therefore, if you need such an adjustment, make...

    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: joining multiple tables without a join

    skippyV (8/5/2016)


    ScottPletcher (8/4/2016)


    Given that there is no clustered index now, you might as well clus to match this query, something like below. If you have DATA_COMPRESSION available, be sure...

    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: remove duplicate values in a view , without affecting main tables

    Probably this (?):

    SELECT d1.StudentID, d1.VehicleID, d1.VehicleType

    FROM (

    SELECT *, ROW_NUMBER() OVER(PARTITION BY StudentID, VehicleID

    ORDER BY CASE WHEN VehicleType...

    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 - 4,216 through 4,230 (of 7,619 total)