Forum Replies Created

Viewing 15 posts - 6,841 through 6,855 (of 7,619 total)

  • RE: Error converting data type varchar to numeric

    Code below should take care of the 'C' type.

    The 'B' type is attempting to concatenate chars and numerics, which will always cause a conversion error, so it definitely needs changed...

    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: consecutive days count irrespective of weekends, holidays

    SELECT

    Studentid,

    MIN(dateid) AS First_Absence_Date,

    MAX(dateid) AS Last_Absence_Date,

    COUNT(*) AS Total_Consecutive_Absences

    FROM (

    ...

    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: Link server locking tables

    wnarretto (2/5/2013)


    Thank you Mr. Pletcher....

    yes the original code is doing a select into. Your answer is what i was suggesting but a coworker mentioned that their was a filter...

    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: Link server locking tables

    Are you doing a SELECT ... INTO?

    If so, that may hold schema locks for the entire duration.

    Instead, do an initial "dummy" SELECT ... INTO ... WHERE 1 = 0 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: conditionnal auto-increment

    Want a cool sig (2/5/2013)


    The link you are referring to is the first one in my signature. Unfortunately it doesn't do much good here because the OP is " 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".

  • RE: Performance Issue - understanding query plans

    nick.mcdermaid (2/5/2013)

    2. HOW can I give SQL Server the clue that the ranges are mutually exclusive? There are no constraints that I can put on the table to indicate this.

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

  • RE: date conversion

    If Dec 31, 1967 is the "border" date, and the date and time values really are separate integers::

    For a date only:

    SELECT

    DATEADD(DAY, UniDataDays, CAST('19671231' AS date))

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

  • RE: What Gives Better Performance?

    opc.three (1/31/2013)


    "Forwarding pointers" only if we're talking about a heaps, else a page split. Neither is good though. If you have a column that will initially be empty, even 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: ALLOW_PAGE_LOCKS=OFF

    GilaMonster (2/1/2013)


    jfogel (2/1/2013)


    One last question. I read that when executing the enable RCS command that there can't be any other connections or transactions open in that database.

    Correct

    Then the article goes...

    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: Advices for best practices for configuring MS SQL Server system databases?

    Ed Wagner (2/1/2013)


    Also, btw, turn on IFI unless for security reasons you can't. That will dramatically speed up data file growth on all databases, including system ones.

    What is IFI?

    Try...

    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: NOT makes query never complete?

    I suspect the dbo.sales should really be clustered by date. If so, and you fix that, the rest of the query won't hurt the performance that much one 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".

  • RE: Duplicate Names, but Not Duplicate IDs

    If you can do w/o the direct DupesCount, you can also use an EXISTS check:

    SELECT

    dm.*

    FROM @DuplicateMembers dm

    WHERE EXISTS (

    SELECT 1

    ...

    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: Duplicate Names, but Not Duplicate IDs

    I like the technique overall, but the concatenation will likely hurt performance: maybe only slightly, maybe a lot, depending on indexing. Thus, I suggest GROUPing and JOINing w/o any...

    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: Data file unused space issue

    For a 500GB db, those are modest amounts of space to be available/reserved.

    I think trying to shrink that db would do far more harm than good.

    If you have multiple data...

    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: Multiple values in same column

    You need to go thru the process of designing tables to store what you need, including a process called "normalization".

    Under no circumstances should you attempt to store multiple values 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".

Viewing 15 posts - 6,841 through 6,855 (of 7,619 total)