Forum Replies Created

Viewing 15 posts - 6,031 through 6,045 (of 7,619 total)

  • RE: Odd issue with leading zero's from a varchar being dropped.

    If there's a NULL in the "NOT IN" list, no rows will be excluded, so you may be seeing rows -- including without leading zeros -- that you didn't expect...

    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: Help With Trigger Delete SQL

    ALTER TRIGGER triggerDeleted

    ON [table_name]

    AFTER DELETE NOT FOR REPLICATION

    AS

    SET NOCOUNT ON;

    DECLARE @sql nvarchar(max);

    SET @sql = (SELECT

    'EXEC [procedure_name] ' + CAST(ID AS varchar(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: Second resultset of stored procedure into a temp table - also, what's the best way to flay a develoer?

    You're welcome! At least you don't need to change much of 3500 lines of 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".

  • RE: Parameter datatypes linked to underlying table column datatype

    Sadly, you can't do that directly in SQL Server.

    The only way to simulate that would be to use alias data types -- lots of aliases.

    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: Variables being ignored ?

    I think the issue may be that this format of query:

    SELECT @variable = column FROM table WHERE ...

    leaves the original value of @variable in place if a row is 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: Second resultset of stored procedure into a temp table - also, what's the best way to flay a develoer?

    Honestly, I'd probably kludge this one if possible.

    See if you can add an optional flag as a parameter to the proc to indicate that the first result set is 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: Need to Create Partition to an existing Table

    Jeff Moden (6/6/2014)


    rangu (6/6/2014)


    Thanks Scott, for your valuable inputs and thoughts.

    However I haven't got the answer yet, when exactly do we need to go for Table Partition and Page compression....

    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: Need to Create Partition to an existing Table

    rangu (6/6/2014)


    Thanks Scott, for your valuable inputs and thoughts.

    However I haven't got the answer yet, when exactly do we need to go for Table Partition and Page compression. If 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: Need to Create Partition to an existing Table

    You can only have one clustered index, but the PK does not have to be the clustered index.

    When time is available:

    1) Drop the existing indexes (Edit: non-clustered first, clustered last)

    2)...

    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: Indexing tips for MIN() and MAX() in queries

    Lynn Pettis (6/6/2014)


    sqldriver (6/6/2014)


    sql-lover (6/6/2014)


    It is my understanding that an aggregate function has to check all values in the column. So an Index on that attribute may not help too...

    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: Indexing tips for MIN() and MAX() in queries

    Actually MIN() and MAX() could use an index, even a seek, if the index was keyed on all the GROUP BY columns in the proper order.

    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: Need to Create Partition to an existing Table

    Though it has a clustered in the name of Primary Key and a non Clustered Index in our case is a date column, as this is most frequent column used...

    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: Need to Create Partition to an existing Table

    rangu (6/6/2014)


    Thanks for your response Scott, [hist_row_id] acts as a Primary key for that table, so acts a Clustered Index anyway.

    And today it has 34M may not look many,...

    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: WITH(NOLUCK)

    The notion that RCSI is "free" and should "always" be used is as wrong as the notion that "NOLOCK" is "free" and should "always" be used.

    There are at least two...

    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: Empty sys.dm_db_missing_index_group_stats

    It's also theoretically possible that the feature has been disabled by starting SQL with a "-x" switch. Not likely, but possible :-).

    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 - 6,031 through 6,045 (of 7,619 total)