Forum Replies Created

Viewing 15 posts - 4,651 through 4,665 (of 7,619 total)

  • RE: Query Performance Problem

    Sergiy (11/16/2015)


    ScottPletcher (11/16/2015)


    But there is still no reason whatsoever to cluster this table by identity.

    Actually, there is.

    And I pointed on it in my previous post:

    to preserve...

    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 Performance Problem

    Sergiy (11/16/2015)


    ScottPletcher (11/16/2015)


    [Yes, (maybe) that gives you less fragmentation on the base table, but that's irrelevant if you (almost) never look up by the id anyway!!

    I'd say it this...

    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: SP querying another database - No error when column name is incorrect

    Arjun Sivadasan (11/16/2015)


    ScottPletcher (11/16/2015)


    If the table does not exist at all, SQL defers name resolution ("deferred name resolution") for that table.

    <snip/>

    Thanks for the reply Scott. If a table does 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: Query Performance Problem

    Sergiy (11/16/2015)


    ScottPletcher (11/16/2015)


    but still cluster the table on the RedemptionCode.

    Clustering a column with randomly generating values is not the best approach ever.

    That's a drastic overstatement. Remember, 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: Shrinking Database

    The best solution is to tune the existing indexes, starting with verifying that you have the best clustered index on every table. Btw, empty/unused space within the db will...

    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 Performance Problem

    I don't think SQL will have to use an implicit conversion for varchar to char, since it pads spaces when doing character comparisons anyway. Not 100% sure, so I'd...

    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: SP querying another database - No error when column name is incorrect

    If the table does not exist at all, SQL defers name resolution ("deferred name resolution") for that table. That is, it waits until run time, then checks 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: Clarification on SARGable predicates

    pollokoff (11/13/2015)

    However, using [IS NULL] does not result in the use of the index that exists on the EXPIRATION column.

    ...

    The question was more for general knowledge. The actual query...

    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: 4 Queries Required Very Urgent

    Brandie Tarvin (11/13/2015)


    I've been looking at the data (i.e., the column names) and I just realized this is Adventure works. So I looked again at the problems, actually reading them...

    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: t-sql 2012 passing lot of values in a parameter

    Sorry, I should have been clearer on that point!

    DelimitedSplit8K is an inline table-valued function for SQL Server, but it's not part of SQL itself, it was developed by users. ...

    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: t-sql 2012 passing lot of values in a parameter

    Best is to use a very efficient splitter, such as DelimitedSplit8K, and then do an INNER JOIN to those results:

    DECLARE @custID varchar(200)

    set @custID = '72793,60546,91069'

    SELECT tn.*

    FROM table_name tn

    INNER JOIN dbo.DelimitedSplit8K...

    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: 4 Queries Required Very Urgent

    He wants to do nothing himself. I tried to walk him thru the logic of how to code #4 in his original q, here:

    http://forums.sqlteam.com/t/need-help-case-statement-should-work/4070

    but he refused, instead basically just...

    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: SET CONCAT_NULL_YIELDS_NULL and legacy code

    Explicitly set it ON immediately before DELETE/INSERT/UPDATE statements and OFF immediately afterward?

    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: Change table structure

    You can also do it with just a single scan of the data table:

    SELECT ca1.*

    FROM table_name

    CROSS APPLY (

    VALUES(Car, ColorOption1),(Car, ColorOption2),(Car, ColorOption3)

    ) AS ca1(Car,ColorOption)

    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 Log File Size: When does a change take effect?

    I wouldn't use the gui for that, although, to be fair, the gui usually does ok on that particular task. But it's so relatively flaky on others that I...

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