Forum Replies Created

Viewing 15 posts - 3,916 through 3,930 (of 7,613 total)

  • RE: Trigger help

    Yes, the "SET NOCOUNT ON" should be w/i the trigger code itself:


    CREATE TRIGGER trEMCondition_INSERT
    ON dbo.vEMLocationHistory
    AFTER INSERT
    AS
    SET NOCOUNT ON;
    UPDATE e

    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: Manipulate two columns of information into one column for each type of data.

    I'd have to see the specific code, but it appears the GROUP BY is not complete/correct:

    SELECT
    ID, NAME,
    MAX(CASE WHEN TestType.id = 1 THEN Testing.score END) AS Reading,

    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 overcome the identity column "jump 1000" issue

    More than 50% of the time, identity is the wrong clustering key, because there's another column(s) that is(are) more valuable overall as the one and only clustering key. The single...

    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: Encapsulating complex logic without using a scalar UDF

    Or this:


    SELECT FirstDate, SecondDate, ExpectedResult,
    ABS(DATEDIFF(year, FirstDate, SecondDate)) as CurrentMethod,
    CASE WHEN SecondDate >= FirstDate THEN
      CASE WHEN (DATEPART(MONTH, SecondDate)...

    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: Manipulate two columns of information into one column for each type of data.

    As below.  Or, if you need to show blanks rather than NULLs, then:
    ISNULL(CAST(MAX(CASE WHEN TestType.id = 1 THEN Testing.score END) AS varchar(4)), '') AS Reading,
    etc.

    [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: QueryOptimization

    You don't need an identity column on this table: it just corrupts the table design and performance (and is a moderate waste of disk and RAM as well).  There really...

    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: Whitespace in 3-part name ignored???

    RonKyle - Wednesday, March 8, 2017 1:48 PM

    I would never name a column 'authorization'. It would be something...

    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: Whitespace in 3-part name ignored???

    Eric M Russell - Wednesday, March 8, 2017 1:16 PM

    I would never name a column 'authorization'. It would be something like 'AuthorizationDate'...

    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: Whitespace in 3-part name ignored???

    RonKyle - Wednesday, March 8, 2017 12:10 PM

      If that happens to be a reserved word, so be it. 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".

  • RE: Whitespace in 3-part name ignored???

    I'll use the best column name for the particular data/business requirement.  If that happens to be a reserved word, so be it.  I don't go out of my way 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: Trying to find the correct occurance!

    Are you allowed to create a split function in the tempdb db?  Ask them.  It will make this much easier and more consistent to do.  Of course you'll need 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: Getting jobs that failed for a period of time

    You need to define a "week", that is, what day do you consider to be the start of a week?

    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 overcome the identity column "jump 1000" issue

    Use the SQL start up proc to adjust the identity value back to a lesser-gap value.  You can do a MAX($IDENTITY) to get the highest current value, add 1 (or...

    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: Upgrading 2008 r2 SP2 to 2008 r2 SP3 - any concerns?

    Yeah, you should have no problems with applying a new svc pack.

    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 Help Refuting a Statement about Normalization

    amy26 - Friday, March 3, 2017 8:41 AM

    I mean its a business rule that they want the field to be the way...

    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,916 through 3,930 (of 7,613 total)