Forum Replies Created

Viewing 15 posts - 7,381 through 7,395 (of 7,613 total)

  • RE: Is there a way to generate an insert stored procedure

    You really should use the sys.* views to generate the code, rather than using the INFORMATION_SCHEMA views, because, according to Books Online:

    "

    Do not use INFORMATION_SCHEMA views to determine the schema...

    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: Stored Procedure Errors - Read Log via T-SQL?

    written an SP that uses a table that doesn't exist

    I think your best chance is to try the following DMVs:

    sys.dm_sql_referenced_entities

    sys.dm_sql_referencing_entities

    Other than that, I don't of anything else within 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".

  • RE: any way to determine when a GRANT was done...

    wonder why this isn't tracked in the catalog.

    I suspect it was to keep down overhead.

    MS could theoretically have logged tons of things like that in SQL, which would 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".

  • RE: WHERE Clause, IF FLAG = 0 ignore the condition

    UPDATE #Worked

    SET

    Tag = 1,

    @UseIt = A.Student

    FROM #Worked A (UPDLOCK)

    INNER JOIN

    (

    SELECT TOP...

    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: general indexing question

    Typically non-clustered indexes are not needed here, since you specify columnA in (virtually) all queries, in a reasonably narrow range.

    Of course sometimes they do help specific queries, so you could...

    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 grab both old and new PK

    Why not just add a column in the table for the "old" id column?

    It's only 4 more bytes, and you'd then be able to reference that column in...

    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: general indexing question

    Cluster by columnA (date/datetime) only.

    That will keep the clustering key short but still restrict the number of rows a query must read and evaluate.

    Sometimes additional column(s) are appropriate for 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: Why Database Space Available decreases when reducing column size?

    I wouldn't expect it to change the space available at all, so I'm guessing other activity reduced the space available in the table.

    Just to be sure, you did use an...

    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: Indexing... Considerations for high (but predictable) INS/DEL activity.

    I'm not horribly against the idea of dropping the FK, but maybe I'm not fully understanding the advantage of doing so. How does deleting the parent records first improve performance?

    It's...

    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: Indexing... Considerations for high (but predictable) INS/DEL activity.

    Then why even have the constraint at all then. If all inserts/updates and deletes are done under controlled access methods (ie SPs) and ad-hoc access to the database is 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".

  • RE: Indexing... Considerations for high (but predictable) INS/DEL activity.

    Might not be a good idea if inserts are expected while also doing the deletes.

    Perhaps, if you really normally do INSERTs that would violate the constraint. Hopefully that's extremely...

    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: Indexing... Considerations for high (but predictable) INS/DEL activity.

    I think the point sturner was making was that your order of deletion would violate the foreign key constraint.

    That's a good point; yes, I wasn't sure if indeed such 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: Indexing... Considerations for high (but predictable) INS/DEL activity.

    Should I be looking at tuning the fill factor in this situation? Higher or lower than "stock"?

    Yes, it can be very applicable to non-clus indexes.

    You would lower the fillfactor,...

    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: Indexing... Considerations for high (but predictable) INS/DEL activity.

    That wouldn't work if there were FK from the license_message_value table id --> license_message table.

    I reversed the order of the table deletes for performance. By doing the controlling (in...

    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: Indexing... Considerations for high (but predictable) INS/DEL activity.

    If I understand correctly, the license_message table has a:

    clus index (/PK) on license_message_id

    nonclus index on archive_date

    <other nonclus...

    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 - 7,381 through 7,395 (of 7,613 total)