Forum Replies Created

Viewing 15 posts - 3,781 through 3,795 (of 7,619 total)

  • RE: INFORMATION_SCHEMA views

    I never use the I_S views.  I've found them to be very slow and to cause blocking at times.  I know their official view definitions don't show why that would...

    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: Difference in row-size between what was expected and what was — can anyone explain please?

    Sean Redmond - Tuesday, August 8, 2017 9:31 AM

    I expected that each row would in or around 19 bytes long. Instead, each...

    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: Expensive View help

    In cases where you do need a scalar function, for max efficiency, get rid of any local variables that are not absolutely required:


    CREATE FUNCTION [dbo].[ufn_GetPlannersName](@intFeasibilityRequestId...

    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: Index Usage Question

    The table definition could be adjusted for efficiency.

    At a minimum, get rid of the formatting chars in the phone# and make both it and zip char rather than...

    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: What is the purpose of dropping temp db?

    As noted, the code should be retained for debugging uses, but it should be modified some.

    1) Be sure to add this statement before it:
    SET @DropTempDB = ''

    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 better join my queries and prevent usage of functions

    I'll give it a guess.  Typically now you use OUTER APPLY to do the type of lookup  you're trying to do.  You also definitely don't need to join the table...

    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: Distinct query with all columns

    Add a clustering index to pre-sort at least a few of the values.  Just based off the very limited data you gave, I'd suggest something like this:

    CREATE CLUSTERED...

    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 Design Theory regarding best practices for querying tables

    roger.plowman - Wednesday, July 19, 2017 8:23 AM

    ScottPletcher - Wednesday, July 19, 2017 8:01 AM

    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 Design Theory regarding best practices for querying tables

    roger.plowman - Wednesday, July 19, 2017 7:06 AM

    ScottPletcher - Tuesday, July 18, 2017 11:12 AM

    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 Design Theory regarding best practices for querying tables

    The first required step in getting reasonably decent table designs is to get rid of the myth that every table has to have an identity column and, far worse, should...

    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: Deadlock on TempTable in SP

    Table variables are almost always much slower than temp tables.  I wouldn't use table variables unless I knew it was only 1 or 2 rows, ever, period, or I had...

    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: Deadlock on TempTable in SP

    If he is actually doing a SELECT ... INTO #temp, that could cause blocking, perhaps long blocking, but it normally wouldn't cause true "deadlocks".  Is it an actual deadlock or...

    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: Schema Stability Locking

    That's a system-generated constraint name for an implicit DEFAULT constraint, such as:

    USE tempdb;
    CREATE TABLE table1 ( column1 int DEFAULT 0 );
    EXEC sp_help 'table1';
    DROP TABLE table1;

    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: Problem with using a field parameter, in a user defined function

    If you want to apply a table-valued function to a string from a table, you need to use APPLY, typically CROSS APPLY.  Something like this:

    SELECT *...

    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: Cursor Performance

    For that one query, try putting the variables into a (keyed) temp table (not a table variable), then joining to that table.:

    CREATE TABLE #ids ( id...

    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 - 3,781 through 3,795 (of 7,619 total)