TSQL Case Statement help

  • CELKO (10/2/2012)


    NO! We hate UDFs; they are not declarative, do not optimize and stink of 1950's FORTRAN. SQL is declarative and uses tables! This is a huge change in your mindset.

    I don't know what you think declarative means, but the function that the OP is considering most certainly IS declarative in the sense the term is used by computer scientists and mathematicians, which is probably the only sense in which it should be used in a forum about T-SQL.

    Tom

  • ChrisM@Work (10/3/2012)


    CELKO (10/2/2012)


    ...NO! We hate UDFs; they are not declarative, do not optimize ...

    Nonsense. The OP has explained that (s)he is a novice, Joe, and is willing to learn or wouldn't be contributing on this thread. Feeding new pupils with dogma is unethical and unprofessional. You're wrong about optimisation too - iTVF's are subbed into the plan just like a view. Look no further than the two articles by Paul White referenced in my signature block.

    +1

    Tom

  • CELKO (10/2/2012)


    ...

    NO! We hate UDFs; they are not declarative, do not optimize and stink of 1950's FORTRAN. SQL is declarative and uses tables! This is a huge change in your mindset.

    ...

    Dear Mr Celko,

    It's a pure lie! YOU may have some psychophysical problems, so you hate UDF's and feel language smells. There are may be some more like you around, but at least I am not one of them, so "some of your kind" doesn't build into "WE" on this forum.

    So, WE don't! We don't hate UDF's and most of us don't feel any smells from 1950's.

    It would be really great if you could learn your native language a bit more: "I" is used for first-person singular expressions, until you refer to yourself as to monarch (I'll be very surprised if US man/patriot would really do that;-)) or you have split personality disorder (I hope you don't speak too often to Murat?) :w00t:

    OP has stated he is new in SQL, and he is asking for help not for some outdated and irrelevant personal stances on SQL Server powerful features from some theoretical demagogues.

    But you are wrong even from theoretical point of view.

    Functional programming is a subtype of declarative programming! It attempts to minimize or eliminate side effects, and is therefore considered declarative!

    Also you are wrong about UDF optimization in SQL Server server. They are optimized!

    Some more than another but optimized!

    You better learn a bit more how to write proper UDF function before making such comments!

    Good luck with sale of your literature 😉

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Dudes..calm down...

    What i ended up doing is creating a table in Excel and imported into the datawarehouse from which created a join in my query

    I'll keep playing around with Stored Proceedures and Functions until i feel im at a competent level

    Could the Mods please freeze this thread before some real abuse gets hurled around

  • /* Removed to respect OP's wishes */ 🙂

Viewing 5 posts - 16 through 19 (of 19 total)

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