Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 7,613 total)

  • Reply To: clustered index usage

    Snargables wrote:

    So just to clarify. if i have a clustered index on say contactid and invoiceid however none of the updates are on those columns then there wouldn't be 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".

  • Reply To: SQL Server Assertion Error

    Are you on the latest CU?  If you are behind any maintenance patch, I'd put that on first before doing other work.

    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".

  • Reply To: Trying to return strings starting with 'dbo.'

     

    SELECT SUBSTRING(TableName, CHARINDEX('dbo.', TableName), 8000) AS TableName

    FROM dbo.whatever

    WHERE TableName LIKE '%dbo.%'

    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".

  • Reply To: Missing Indexes

    WARNING: make sure that no more than, say, 3500 tables or so are processed by this script.  The script is fairly complex and having way too many tables present  (particularly...

    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".

  • Reply To: Trying to return strings starting with 'dbo.'

    If you just want table names that start with 'dbo.', then you can do this:

    SELECT STUFF(Tablename, 1, 4, '') AS Tablename
    FROM dbo.ListOfTables
    WHERE Tablename LIKE 'dbo.%' /*allows 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".

  • Reply To: Missing Indexes

    You can't ever look at missing index stats in isolation.  You also need to look at existing indexes and their usage stats (and often I/O counts as well).

    First, before doing...

    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".

  • Reply To: Changing the structure of a NUMERIC column in a partitioned ColumnStore table

    Vince Poirier wrote:

    Thanks for the answer,

    We already have views on top of our tables, so it would be easy to do. But that would serve no purpose. The main goal 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".

  • Reply To: Changing the structure of a NUMERIC column in a partitioned ColumnStore table

    Going from 28 to 19 would reduce the storage required, so, as you've discovered, I think SQL would create a new column and copy the data over to it.

    If you...

    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".

  • Reply To: Complicated insert

    SELECT ca1.*
    FROM dbo.Table1 t1
    CROSS APPLY (
    SELECT EmpNo, EmpName, DeptName, Location
    UNION ALL
    SELECT EmpNo, EmpName, DeptName, Location
    ...

    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".

  • Reply To: The same value across 5 or more columns in a table , How can I write a query

    CONCAT is not a safe way to do this because different values could appear to be the same.

    Do all the columns have to match?  Or just some?

    For now, I'll assume...

    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".

  • Reply To: Missing Indexes

    There could be a lot of different reasons for latency.  Did this just start recently?  Here are some possible things; (1) should be done first, the others are in no...

    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".

  • Reply To: Can I safely force the plan without the table spools?

    We need to see the DDL for Clicks2 and Clicks3 as well.  Particularly if those tables are not clustered uniquely on ClickID, the MERGE join could be less efficient.

    As Jeffrey...

    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".

  • Reply To: Return a list of all columns in a table with more than X % filled

    For efficiency, you should really just scan the table once to count all columns, as the code generated below does.  I've added the view name as input so the code...

    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".

  • Reply To: Need help optimizing TSQL

    Michael L John wrote:

    ScottPletcher wrote:

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Michael L John wrote:

    ScottPletcher wrote:

    Michael L John wrote:

    My favorite lie is that NOLOCK improves performance.

    Of course it must vs taking locks.

    "and use snapshot isolation."  MEGA-HUGE overhead.  SI 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".

  • Reply To: Need help optimizing TSQL

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Michael L John wrote:

    ScottPletcher wrote:

    Michael L John wrote:

    My favorite lie is that NOLOCK improves performance.

    Of course it must vs taking locks.

    "and use snapshot isolation."  MEGA-HUGE overhead.  SI should only 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".

Viewing 15 posts - 1,066 through 1,080 (of 7,613 total)