Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 9,702 total)

  • RE: replace null with another column

    drew.allen (1/4/2017)


    CASE is clearly more flexible than COALESCE, because it can perform any conditional test whereas COALESCE only tests whether an expression is NULL, and because it can return any...

  • RE: Non-alphanumeric Search Frustration

    Alan.B (1/4/2017)


    Sorry for the off-topic rant; just some food for thought.

    Not at all off topic. You made some very good points. As did Luis about using the functions.

    Thank you both...

  • RE: Non-alphanumeric Search Frustration

    Eric M Russell (1/4/2017)


    If the user entered codes are not relationally tied to any other table, then what are the ramifications of them being entered "wrong" ?

    As I said, these...

  • RE: Non-alphanumeric Search Frustration

    Just to clarify. The data is coming from a vendor-created database. I cannot make changes to it. I can, however, send emails to the users saying "Fix this item, it...

  • RE: Non-alphanumeric Search Frustration

    Eric M Russell (1/4/2017)


    As a side note, it would be great if all valid codes could be pre-loaded into a primary keyed master table, then data validation could be enforced...

  • RE: Non-alphanumeric Search Frustration

    Luis Cazares (1/4/2017)


    Does this works?

    IF (SELECT OBJECT_ID('tempdb..#MyTemp')) IS NOT NULL

    DROP TABLE #MyTemp;

    CREATE TABLE #MyTemp (QuestionableColumn CHAR(20));

    INSERT INTO #MyTemp (QuestionableColumn)

    VALUES ('ABC1GKUCEEF7AR169582'), --Good value

    ('ABC2G1WG5E37D1157775'), --Good value

    ('BCD3GTU2TEC9FG119962'), --Good...

  • RE: Non-alphanumeric Search Frustration

    Thom A (1/4/2017)


    Brandie Tarvin (1/4/2017)


    Thom A (1/4/2017)


    I'm a little confused,on one part. You stated that "a hyphen is only allowed after the first character", however that the value "ABC-1245Z" is...

  • RE: replace null with another column

    drew.allen (1/4/2017)


    Brandie Tarvin (1/4/2017)


    I like CASE personally because it allows me to alter values being returned (or add new information) where as COALESCE just returns the original value.

    But you can...

  • RE: replace null with another column

    The main differences between CASE and COALESCE() are that COALESCE() is faster to type and CASE gives you other data manipulation options. Otherwise, they are mostly identical in the way...

  • RE: Non-alphanumeric Search Frustration

    Thom A (1/4/2017)


    I'm a little confused,on one part. You stated that "a hyphen is only allowed after the first character", however that the value "ABC-1245Z" is acceptable. The hyphen is...

  • RE: replace null with another column

    Or use a CASE statement.

    SELECT Col1, Col2,

    CASE WHEN cte1.Col IS NULL THEN cte2.Col ELSE cte1.Col END AS MyCol

    FROM ....

    This assumes that you can join the CTEs to each other...

  • RE: Are the posted questions getting worse?

    Siiiiiigggggghhhhh.

    You would think when I get an alert that a log file drive is full in a non-prod system the first thing I would look at is whether or not...

  • RE: Are the posted questions getting worse?

    Eirikur Eiriksson (12/16/2016)


    Phil Parkin (12/16/2016)


    Grumpy DBA (12/16/2016)


    Wow, today's spam includes a warning about BOOTY POP... dang, just as I was about to order cases of BOOTY POP for my family...

  • RE: Are the posted questions getting worse?

    Beware the Twitter list. For it is a way of defining you and boxing you into a corner!

    Actually, lists can be followed as a whole (I don't remember how) so...

  • RE: Are the posted questions getting worse?

    JustMarie (12/13/2016)


    drew.allen (12/13/2016)


    Does any else think that this response borders on being unethical? http://www.sqlservercentral.com/Forums/FindPost1842475.aspx It sounds like she wants to use this approach just to avoid due...

Viewing 15 posts - 1,231 through 1,245 (of 9,702 total)