Forum Replies Created

Viewing 15 posts - 3,886 through 3,900 (of 7,619 total)

  • RE: Best practice

    jmcnorrill - Tuesday, March 28, 2017 3:18 PM

    ScottPletcher - Tuesday, March 28, 2017 3:12 PM

    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: Best practice

    Another option could be to use a static view that is dynamically generated for the formulas.  When a formula(s) change, the view is regenerated.  Just an idea.

    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: fill factor with clustered PK on identity PLUS another column

    The first focus should be on getting the best clustered index on all (significant) tables.  That is the single most critical performance factor for most tables.  Hint: This is most...

    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: Best practice

    Looks rather straightforward, since the detail table already contains the Position the person was in on that given day.

    If  you could post useable sample data -- CREATE 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: trigger that fires on updates NOT from application

    The trigger would still fire, but you could have it immediately exit.  The easiest way is likely using CONTEXT_INFO.  Have the app set the first two bytes of it 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".

  • RE: fill factor with clustered PK on identity PLUS another column

    Most of our tables have a clustered PK on an integer identity column.

    Common, but not the best.  You'll hurt your overall performance significantly this way.

    These...

    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: Format Varchar as datetime2

    You don't need or want the dashes in the date:


    SELECT STUFF(STUFF(STUFF(main_datetime, 13, 0, ':'), 11, 0, ':'), 9, 0, ' ') + '.0000000' AS datetime2_format,

    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 metadata inconsistencies

    USE database_name;
    ALTER DATABASE database_name SET SINGLE_USER;
    DBCC CHECKDB ( database_name, REPAIR_REBUILD );
    ALTER DATABASE database_name SET MULTI_USER;

    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 Server primary key on float data type

    Check for a way to override the data type to be bigint (or even int, if you know that will hold all the values) instead of float(53).

    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 metadata inconsistencies

    I'd certainly try to fix it without allowing SQL to lose any data.  If it can fix it cleanly, why leave it bad?

    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 max value from second table

    Something like this should do it:

    .
    SELECT t1.CreateDate, t2.CreateDate, DATEDIFF(MONTH, t1.CreateDate, t2.CreateDate), t1.AtNumber, t1.HFK
    FROM Table_1 t1
    LEFT OUTER JOIN (
      SELECT *, ROW_NUMBER() OVER(PARTITION...

    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: How to use a select statement to get a parameter

    Or, if you want to allow @VisitID to be specified but not to require it:


    ALTER procedure [dbo].[spRadialAnalyticsDataExtract_ADLAssessment]
    (
    @AccountNumber varchar(30),
    @VisitID varchar(30) = NULL
    )

    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: what is sql logic needed to categorize objects by how much they have in common with other objects

    If you just want a count of the common attributes, you could do this:

    SELECT RT1.ReportName AS ReportA, RT2.ReportName AS ReportB, COUNT(*) AS CommonAttributesCount
    FROM ReportTable RT1
    INNER JOIN...

    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: what is sql logic needed to categorize objects by how much they have in common with other objects


    SELECT RT1.ReportName AS ReportA, RT2.ReportName AS ReportB, RT1.AttributeName AS AttributeInCommon
    FROM ReportTable RT1
    INNER JOIN ReportTable RT2 ON RT2.ReportName > RT1.ReportName AND RT2.AttributeName = RT1.AttributeName

    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: what is sql logic needed to categorize objects by how much they have in common with other objects

    If you'll post some directly useable data -- CREATE TABLE and INSERT statements -- I'll provide you code to do this (or someone else will first).

    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,886 through 3,900 (of 7,619 total)