Forum Replies Created

Viewing 15 posts - 3,736 through 3,750 (of 7,613 total)

  • RE: Performance choice: computed persisted field in aa base table, vs. identical computation in a view...

    I think you've got the computed column backwards here.

    That is, since the data is supposed to be in 1NF, the "divided by 10" value should be in 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: Leverage window function to break out of triangle join?

    Some refinement is possible.  For example, for any single column that has a unique index on it, you wouldn't need to count the values, instead simply get the number of...

    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 Grant User View Definitions to Database Objects?

    One of the main reasons to not give VIEW DEFINITION to users is so that they can't see the underlying physical table names.  If you let them know the physical...

    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: Get the year and Qtr

    Jeff Moden - Monday, September 25, 2017 9:40 AM

    ScottPletcher - Monday, September 25, 2017 8:14 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: The order of TRUNCATE and DROP / DISABLE NONCLUSTERED INDEXES

    I'd say you get a slight gain by disabling the non-clus indexes first.  That's because disabling the index requires removing the rows, which requires some minor logging (of page deallocations,...

    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: Get the year and Qtr

    Jeff Moden - Saturday, September 23, 2017 8:24 PM

    Ah... almost forgot.  Neither Scott's nor mine checks to make sure the values of...

    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: Get the year and Qtr

    Or just:


    SELECT LEFT(OrigDateString, 4) + ' Q' + CAST((CAST(SUBSTRING(OrigDateString, 6, 2) AS tinyint) + 2) / 3 AS varchar(1))
    FROM #TestData

    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: Column Length

    Columns lengths have another effect on memory allocation as well.  SQL reserves memory prior to processing a table.  It determines the amount of memory to reserve partly based on column...

    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: Mortgage amortization table

    Jason A. Long - Thursday, September 21, 2017 8:30 AM

    Jeff Moden - Thursday, September 21, 2017 7:10...

    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: Speeding up OBJECTPROPERTY...

    sgmunson - Thursday, September 21, 2017 8:12 AM

    ScottPletcher - Thursday, September 21, 2017 8:10 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: Sql Help

    Or:

    select *
    from lineitems
    where orderid in (select orderid from orders where customerid = @CustomerID)

    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: Speeding up OBJECTPROPERTY...

    I think it's very possible that o.type = 'U' would speed it up, rather than using OBJECTPROPERTY.

    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: Clustered Index Update Slow Update On Large Table

    Move the error details to a different table.  That table could be keyed by the clustering key of this table plus perhaps a sequential error number.

    This table 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: Which is GOOD/BETTER out of two ways of writing a query ??

    There's a fundamental difference between those queries.
    The first is an INNER join to dept, obviously, as explicitly stated, whereas the second is a LEFT OUTER JOIN, although only implicitly.

    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: Concatenate sp_MSForeachdb results


    IF OBJECT_ID('tempdb.dbo.#index_info') IS NOT NULL
        DROP TABLE #index_info;

    SELECT TOP (0)
    dbschemas.[name] AS schema_name,db_name() AS db_name,
    dbtables.[name] AS table_name ,
    dbindexes.[name] AS index_name ,

    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,736 through 3,750 (of 7,613 total)