Forum Replies Created

Viewing 15 posts - 2,176 through 2,190 (of 8,731 total)

  • RE: Split string in two or three columns based on character count

    Another option.

    Note that I'm including 2 additional possibilities to show a problem. The other 2 solutions handle it differently, but not necessarily correctly.

    SELECT Symbol,

    LEFT(Symbol, CHARINDEX('_',...

  • RE: Split string in two or three columns based on character count

    oaucamp (9/9/2016)


    Hi All

    I have a table that contains one column called Symbol. The symbol consists of two or three parts. They are ticker, indicator and dimension or in some cases...

  • RE: Small rounding

    Matjaz Urank (9/9/2016)


    .. and SELECT ROUND( 7.0/10, 0) = 1

    I can't understand why technically this could be an error. But that doesn't mean that this isn't a bug. Does Microsoft...

  • RE: Is Division by Zero NULL?

    Creating a scalar UDF to handle division by zero is a bad idea. It will only slow down queries.

    What's the problem with using NULLIF?

    SELECT numerator / NULLIF( denominator, 0)

    You can...

  • RE: SQL view performance problem

    There's no way anyone can help you from what you posted. You'll need to follow the indications in this article to get actual help: http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    It's not that we don't want...

  • RE: SQL Code QA

    Jason A. Long (9/7/2016)


    Speaking for all the jerk code reviewers of the world... Yes, formatting counts, yes I'll give you crap over it (when you have to read through...

  • RE: REPLACE or alternative?

    Maybe something like this:

    CASE Orders.ptemp

    WHEN 'P' THEN 'Permanent'

    WHEN 'T' THEN 'Temporary'

    WHEN 'B' THEN 'Both'

    WHEN...

  • RE: Queries and joins with different locations.

    This is the closes I could get to your expected results. I have to agree with Grant, the design is incorrect.

    WITH CTE AS(

    SELECT OrderNumber, Location, Total...

  • RE: SQL Code QA

    colin.dunn (9/7/2016)


    Put the join ON clauses on the same line since they were so short.

    I usually have my ON clauses on the same line as my JOIN, but when he...

  • RE: Today's Random Word!

    Grumpy DBA (9/7/2016)


    Ed Wagner (9/7/2016)


    Preserve

    Marmalade

    Lady

  • RE: SQL Code QA

    You should also use column alias in your ORDER BY clause instead of position.

    ORDER BY [Work Type] DESC, [Days Elapsed];

    EDIT:

    Also here are some additional comments

    SELECT --Use the actual length...

  • RE: Today's Random Word!

    Ed Wagner (9/6/2016)


    Revenant (9/6/2016)


    Y.B. (9/6/2016)


    whereisSQL? (9/6/2016)


    Hugo Kornelis (9/6/2016)


    Ray K (9/6/2016)


    Ed Wagner (9/6/2016)


    djj (9/6/2016)


    Ed Wagner (9/6/2016)


    Hugo Kornelis (9/6/2016)


    Stuart Davies (9/6/2016)


    BWFC (9/6/2016)


    TomThomson (9/6/2016)


    Revenant (9/5/2016)


    Treat

    Trick

    Cheap

    Canary

    Wharf

    Worf

    Data

    Riker

    Island

    Beach

    Volleyball

    Top Gun

    Tomcat

    Warthog

    meerkat

  • RE: Case Statement Help

    I believe that you're missing some parenthesis and you might need to change one of the conditions to allow the last part to be evaluated.

    Update Staging

    Set P_Staged_By = CASE

    WHEN P_Staged_By...

  • RE: Are the posted questions getting worse?

    Sean Lange (9/6/2016)


    I tried my hand at curing my own bacon for the first time. It came out of the cure Saturday morning and hit the smoker later on Saturday....

  • RE: Is Division by Zero NULL?

    Gregory Hart (9/6/2016)


    if divide by zero is allowed, it's possible to prove that 1=2

    The above claim would only work in a logical proof if you identified that NULL= NULL ....

Viewing 15 posts - 2,176 through 2,190 (of 8,731 total)