Forum Replies Created

Viewing 15 posts - 1 through 15 (of 7,618 total)

  • Reply To: Massive Table Growth Issue – How to Set Up Filegroup Usage Alerts?

    You can create a standard SQL alert that is based on the db size (in KB) exceeding whatever amount you specify.

    In SQL Server Agent; "Alerts"; "New Alert"; "SQL Server performance...

    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: STRING_AGG DISTINCT

    Interesting q.  No, haven't done that.

    I guess easiest would be to use a subquery, which you're already familiar with, so that's not what you're looking for, but just to 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".

  • Reply To: In-place OS upgrade or migration to new OS?

    Definitely use new VMs.  Too many installation settings could matter here.  The new VM approach also allows you to test with a db to two without having to wait for...

    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: Partitioning a table with TEXTIMAGE_ON option

    No, I don't think you would.  I don't think TEXTIMAGE_ON clause is allowed is a partition scheme is used (based on MS documentation).  Sorry, I don't have time to test...

    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: Using IFF within a WHERE clause

    Don't need IIF, just standard WHERE NOT:

    WHERE NOT (Customer between 99202 and 99215 and State = 'NY')

    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: Increment a number in a SQL Query based on a value

    Sounds like you could use a SEQUENCE.  For example:

    CREATE SEQUENCE dbo.bom_sequence AS int START WITH  9000000 INCREMENT BY 1 NO CYCLE ;

    SELECT CASE WHEN item_number = ''...

    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: Dealing with huge heap tables

    A leading datetime clustering key would not be a problem at all, i.e., there's no reason to exclude a datetime from a clustering key.  As you, and others, have noted,...

    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: data compare between 2 tables with same structure for any changes after etl run

    Hmm, it would have been best to put a data change capture in place before the mods occurred.  If the mods aren't too long and you can go back to...

    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: Daily aggregation of Azure Blob Storage by tier (created/tier-change/deleted)

    Something like this should do it:

    DECLARE @date date;
    SET @date = GETDATE();

    SELECT CONVERT(varchar(8), @date, 112) AS DateKey, StorageTier,
    COUNT(DISTINCT FileId) AS FileCount, SUM(SizeBytes) AS...

    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: When to add indexes suggested from the DMVs

    Performance wise, you don't want the db to contain more than 5,000 to 6,000 tables when using that script.

    To limit the tables to process, specify a different table name pattern:

    ...

    SET...

    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: When to add indexes suggested from the DMVs

    There is no automatic formula that can do this analysis for you, it has to be done by a knowledgeable person.

    If you have a critical table(s) you want reviewed, post...

    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: Which 'Where' statement conditional upon a variable

    For clarity, and potentially accuracy for more complex "OR" conditions, I suggesting another set of parentheses:

    WHERE

    ((@Type = 'AB' AND PlanDescription IN ('DEF','GHI')) OR

    (@Type = 'CD' AND  PlanDescription IN ('UVW','XYZ'))

    )

    Yes, the original...

    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: Case part is sloooooow

    What table is vision_flag in?  Helps for others to follow your code if you use aliases for table and then ALWAYS add an alias for every column name used 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".

  • Reply To: Introduction of OPTIMIZE_FOR_SEQUENTIAL_KEY = ON

    > 3 columns (2 int and 1 bigint) <

    This could be a (rare) case where partitioning is a good idea; partitioning being based on one/both of the 2 int leading...

    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: Adding and Dropping Columns I

    Actually, none of the suggested code, since you should always specify NULL or NOT NULL when ADDing columns to be sure you get the specific setting you want.

    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 through 15 (of 7,618 total)