Are the posted questions getting worse?

  • Lynn Pettis - Tuesday, September 19, 2017 2:39 PM

    OMG!  People are getting so literal!  "I am not using a system table."  Hey!  It was an example!  Get a clue!

    Once upon a time, we were all newbies that might did not have known know better. 😉

    I remember one fellow that responded to a post of mine as if I were the most vicious, underhanded, bloodsucker ever all because I conditionally dropped the Temp Table that was named exactly the same as his real table except that mine had the usual "#" at the beginning.  He honestly thought I was trying to trick him into running my code to drop his table.

    A lot of us came up to speed very quickly (to be honest, it took me longer than most) but we all started that way (especially taking things from "experts" as stated because they're the "experts").  At least he knew what sys.table was. 😉

    Unfortunately, it's how a lot of so called "best practices" are born.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Luis Cazares - Tuesday, September 19, 2017 2:54 PM

    Also, today is the 32nd anniversary of the most devastating earthquake that Mexico has faced, and there was a new one that collapsed several buildings. Please, keep the victims in your prayers.

    One of our Developers grew up there and has family and friends there.  He showed me a video of an 8 or 10 floor building that had very large pieces popping off of it and a drone shot of all the dust coming up from the city were smaller buildings had partially or fully collapsed.  He's not been able to contact any of them yet because cell phone systems and towers took a major hit, as well.

    Wishing you, yours, and your countrymen well, Luis.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden - Tuesday, September 19, 2017 7:22 PM

    Luis Cazares - Tuesday, September 19, 2017 2:54 PM

    Also, today is the 32nd anniversary of the most devastating earthquake that Mexico has faced, and there was a new one that collapsed several buildings. Please, keep the victims in your prayers.

    One of our Developers grew up there and has family and friends there.  He showed me a video of an 8 or 10 floor building that had very large pieces popping off of it and a drone shot of all the dust coming up from the city were smaller buildings had partially or fully collapsed.  He's not been able to contact any of them yet because cell phone systems and towers took a major hit, as well.

    Wishing you, yours, and your countrymen well, Luis.

    Fortunately, most of friends and family have indicated that they're safe. None is reported as missing. My wife and mother in-law were about to take the plane to come to Atlanta. Their flight got cancelled and they hope to be able to travel today.
    At least 30 buildings fully collapsed, others have sever damages. Some were apartment buildings and some were schools with children in them. It's astonishing the multiple videos showing how buildings fall in seconds. But it's impressive how so many people have joined to help each other by offering shelter for victims, removing debris to look for people, bringing food, water and equipment to those people, offering internet access or phone calls.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares - Wednesday, September 20, 2017 7:26 AM

    Jeff Moden - Tuesday, September 19, 2017 7:22 PM

    Luis Cazares - Tuesday, September 19, 2017 2:54 PM

    Also, today is the 32nd anniversary of the most devastating earthquake that Mexico has faced, and there was a new one that collapsed several buildings. Please, keep the victims in your prayers.

    One of our Developers grew up there and has family and friends there.  He showed me a video of an 8 or 10 floor building that had very large pieces popping off of it and a drone shot of all the dust coming up from the city were smaller buildings had partially or fully collapsed.  He's not been able to contact any of them yet because cell phone systems and towers took a major hit, as well.

    Wishing you, yours, and your countrymen well, Luis.

    Fortunately, most of friends and family have indicated that they're safe. None is reported as missing. My wife and mother in-law were about to take the plane to come to Atlanta. Their flight got cancelled and they hope to be able to travel today.
    At least 30 buildings fully collapsed, others have sever damages. Some were apartment buildings and some were schools with children in them. It's astonishing the multiple videos showing how buildings fall in seconds. But it's impressive how so many people have joined to help each other by offering shelter for victims, removing debris to look for people, bringing food, water and equipment to those people, offering internet access or phone calls.

    Good to hear and fingers crossed! Find it incredible that it happened exactly 32 years to the day after the big one.
    😎

  • Luis Cazares - Wednesday, September 20, 2017 7:26 AM

    Fortunately, most of friends and family have indicated that they're safe. None is reported as missing. My wife and mother in-law were about to take the plane to come to Atlanta. Their flight got cancelled and they hope to be able to travel today.
    At least 30 buildings fully collapsed, others have sever damages. Some were apartment buildings and some were schools with children in them. It's astonishing the multiple videos showing how buildings fall in seconds. But it's impressive how so many people have joined to help each other by offering shelter for victims, removing debris to look for people, bringing food, water and equipment to those people, offering internet access or phone calls.

    Great to hear that your friends and Family are safe and accounted for. Hope that they are all well and have somewhere safe to stay.

    Although what has happened is awful, it's great to see that there are times when whole communities pull together to save lives and help others who are worse off than them. The media is far too often filled with news of hatred and acts of Terrorism (North Korea's missiles, the recent failed bomb at Parson' Green (London), the HGV incidents by extremists in Europe, etc). The loss of life is a tragedy, but it's also refreshing to see that people do the opposite, and the lengths they go to to save lives, rather than take them.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Eirikur Eiriksson - Wednesday, September 20, 2017 7:46 AM

    Good to hear and fingers crossed! Find it incredible that it happened exactly 32 years to the day after the big one.
    😎

    And they had an earthquake drill a few hours before the actual earthquake to commemorate that great earthquake.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Alan.B - Tuesday, September 19, 2017 4:44 PM

    SQL Server is so weird sometimes. 

    select 'a'+++++++++++++++++++++++'b'++++++++++++++++++++++++'c'
    returns abc.

    SQL is horribly broken. I know we're used to it, but

    create table mytable (myid int)

    alter table mytable add mychar char(10)

    alter table mytable alter column  mychar varchar(20)

    alter table mytable alter column mychar add masked with (function = 'default()')

    create procedure myproc
    as
    select 1

    alter procedure myproc
      @myid int
    as
    select @myid

    are examples of horrible language design. If I made you write this:

    public static void myMethod (int myparam )
    { // do something
    }

    and

    change public static int myMethod (int myparam, int mysecond)
    {
    return  myparam + mysecond
    }

    you'd  move to Java.

  • Luis Cazares - Wednesday, September 20, 2017 7:57 AM

    Eirikur Eiriksson - Wednesday, September 20, 2017 7:46 AM

    Good to hear and fingers crossed! Find it incredible that it happened exactly 32 years to the day after the big one.
    😎

    And they had an earthquake drill a few hours before the actual earthquake to commemorate that great earthquake.

    Good to hear that they're safe, Luis.  I hope your wife and mother in-law get to Atlanta soon.

  • Luis Cazares - Wednesday, September 20, 2017 7:57 AM

    Eirikur Eiriksson - Wednesday, September 20, 2017 7:46 AM

    Good to hear and fingers crossed! Find it incredible that it happened exactly 32 years to the day after the big one.
    😎

    And they had an earthquake drill a few hours before the actual earthquake to commemorate that great earthquake.

    I hope all your family is all fine mate! I do remember the '85 one, was supposed to be sent there but got diverted to other rescue work at the time.
    😎

  • Jeff Moden - Tuesday, September 19, 2017 6:56 PM

    Alan.B - Tuesday, September 19, 2017 4:44 PM

    SQL Server is so weird sometimes. 

    select 'a'+++++++++++++++++++++++'b'++++++++++++++++++++++++'c'
    returns abc.

    Heh... yep... fun stuff.


     SELECT '1,,,,,,'+$0, ',,,,,,1'+$0, '1,,,,,,1'+$0, '1,,,1,,,1'+$0;

    Shut. The. Front. Door. the concatenation operator I understand completely. What the hell is going on with this one though.....

    -------------------------------------------------------------------------------------------------------------------------------------
    Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses

  • I have no idea. Precedence means that '1,,,,,' is converted to money, but I don't understand why the multiple separators don't cause an error.

  • I would guess the conversion routine simply drops all thousands separators, and then converts to a numeric type:
    declare @var money
    set @var = ',1,00,00.99'
    select @var

  • crow1969 - Thursday, September 21, 2017 9:34 AM

    I would guess the conversion routine simply drops all thousands separators, and then converts to a numeric type:
    declare @var money
    set @var = ',1,00,00.99'
    select @var

    That might be a quick fix they chose to deal with different ways to separate digits, like indian notation.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Must be some artifact of dealing with various numeric notations. Still, strange.

  • That is what I thought as well, Luis.  After a bit more testing, I found that the money datatype is the only one that exhibits that sort of behavior.  All other numeric types give an error trying to set the value from the string.  Also, the money datatype can't take the extra thousands separators unless the value is passed as a string.  Numeric literals need to conform to numeric rules.  I have to admit, this was somewhat fun to play around with.

Viewing 15 posts - 59,956 through 59,970 (of 66,712 total)

You must be logged in to reply to this topic. Login to reply