T-Sql rant

  • george sibbald (3/15/2009)


    Go ahead, put up some more of your cursor-based code, we'll keep doing it and then you can brag to your boss how you improved the performace of your system by rewriting all that cursor-based code and improved them by eliminating the cursors.

    you just hit the nail on the head Lynn. This guy is not only a troll he's bleeding you dry for info to fix his poor code. Leave him to stew.[/quote]

    You did catch the sarcasm in my comment, didn't you? 😉 I don't think any of us would actually keep rewriting his cursor-based code for him.

  • Science is a b****, expediency is a w*****. It's not easy to sleep with science. But sql sells itself to even the lowest bidder. It's been screwing developers forever But sql experts know of what they speak. There is a certain quality to expediency. The seduction by the **** makes the **** easy to forget.

    Vulgar crass and tasteless. I am a woman and I find your post very offensive.

    There you'll find the relational model wedded to the idea of an object oriented language. There's no mismatch here. A table is simply another type. A relational algebra is embedded in a imperative language that is OO.

    That is very wrong because all the object databases failed because they decided to skip the algebra, the words of Oracle's Jim Melton not mine. I have seen many developers trying to move to 64bits in most cases their application is missing DAL and relational model.

    Kind regards,
    Gift Peddie

  • Hear, hear. Well said, Gift.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Gift Peddie, apologies. I've edited the post.

  • If you're going to do that, Steve, you should also edit the subsequent posts where people quoted him.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • Bob,

    Excellent point. I believe all are edited now.

  • Thank you, sir. Good job, and good night.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • Steve Jones - Editor (3/15/2009)


    Gift Peddie, apologies. I've edited the post.

    The last sentence in the quoted paragraph needs corrected also. I have already edited my instance, there's still one or two others though...

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Whether you have 'used' a great deal of t-sql or not, you apparently have not been exposed to enough bad and good sql and the impact on a taxed database server to appreciate the nuggets of wisdom that are being shared in this rant.

    For your point about developing in one language, keep in mind that most of our databases are in a position where they could have to support multiple languages. Your app only has to deal with SQL Server, so you are not thinking about the needs of writing an application that COULD be hosted on multiple server platforms. Some of us write shrink wrap applications that can be deployed into our customers environment against the DB host of their choice.

    Your premise of MS catering to a c# specfic view of the DB is flawed. If MS made a c# "version" of t-sql, what would their obligation be to their VB, FoxPro, J#, F#, C++ developers? Does it make sense for them to cater to every language in the pipeline to make the database do what it needs? Or to focus on the industry standard? I too am a C# developer, but I can appreciate how MS splitting their focus to rewrite the same data access code in each language would be nuts. And completely unfair to the DBA that has to support the server.

    Currently there is a huge mindshare of SQL compliant DBA's and developers, many of which could handle your problems and teach you better ways to attack them. I learned a lot working next to a no-nonsense DBA. If a query was affecting his production systems, he would kill it and let the responsible developer and his supervisor know. Two ways to handle this... rant (-: or learn. I asked him what was wrong, and if he could point me at something better to try. For his help I am a much better SQL Developer, and this was after having worked with SQL for a large number of years. Now the fun part of this discussion is that I had worked at this for for three weeks when this discussion happened. Other SQL developers considered him to be a tyrant. Their code was clocking in a not very respectable 100 records per minute. I refined the same procedures and had things humming along at 3000 records per second. For a mass marketing company, this is a big deal.... I have since left them, but the lessons learned... invaluable regardless of my front end language

    That is the difference that you are missing here. It is not that we are locked into a passion for t-sql, it is that real world performance concerns of our applications are better handled by the appropriate use of the appropriate tool. I think it would behoove you to benchmark some of the suggestions that have been provided to you earlier. Compare the run times of your cursor based applications with some of the set based solutions. Do this on tables having more than a few hundred records. Now consider load of the DB from other processes running at the same time.... in an environment where most of the t-sql already developed is not that performant...

  • While features may be deprecated, simply removing (or disabling) a feature would break so much code that no-one would use the new version!

    By the way, you may think you know T-SQL (as I did 5 years ago), but you can always leasrn more.

    And, for infomation, I've been developing for over 20 years and use C, ++, VB(script), Java, Perl, Pascal, Fortran, assembly languages (many), etc. and find that no 1 language can do it all!

    Derek

  • foxjazz (3/13/2009)


    cursors heh

    Excatly my point.... So why doesn't t-sql accomodate sets?

    Why would I need a cursor to do updates like ?

    foreach(select * from table)

    {

    insert into othertable (field) value(myfield) ? Why does this have to be a cursor. I use this type of stuff in .NET all the time.

    }

    Why again why can't t-sql get a datatable (inline) and that way cursors don't need to be used.

    This is my whole point you. Are you guys finally beginning to listen?

    I'm a bit late into this, so this may already have been brought up, but anyone who wants to write code like that in SQL Server should be told to step away from the database and keep his hands in plain view.

    The T-SQL equivalent of the above is "insert into othertable(field) select myfield from table". Simpler, easier, more effective, and easier to read too.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • foxjazz (3/13/2009)


    Ok here is what I would like to do:

    run a query or view that gets a datatable (in t-sql) not c#

    Then run through each record in the datatable that I have, and assign values to insert or update statements at my liesure.

    That is what I would like it to do. Should be easy right?

    And I don't want to have to use cursors to do it.

    Can this be done?

    I don't think it can, or haven't seen it in practice. Mostly I have to write code in c# to get sql to jump through the hoops I need it to with datatable or sets.

    This is why T-Sql sucks. This is why I rant.

    Unless I am wrong, then I would be pleasantly pleased, but I don't think I am wrong.

    You are wrong.

    I write stuff like that in T-SQL all the time, without using any cursors at all. It's actually easier in T-SQL than in C#, once you know how to do it.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • foxjazz (3/13/2009)


    Another point, why should someone that knows c# or vb and does it daily, have to learn t-sql.

    Why can't t-sql accomadate that flavor of language just like the IDL compiler does for .net languages.

    WHY DO YOU HAVE TO GET USE TO IT?

    Thats' just a cop out.

    Why do people who know VB 6 have to learn VB.NET? Why do people who know FORTRAN need to learn C#? Why do people who know English have to learn Spanish? Why do people who know arithmetic need to learn algebra? Why do human beings think more flexibly than computers? Those are all the same question.

    Or I could just reverse your question and ask, since I know T-SQL and can get it to do an amazing array of things, why should I be forced to learn VB.NET in order to build forms and Windows apps, or C# to build efficient Web apps?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Can we just take this one off the fire? It's obviously done. If anyone cares, he posted the exact same rant over in the MS forums and got a couple of similar replies.

    Anyone want to bet that foxjazz is in his mid to early twenties at most? He obviously knows a little something, but wants that to be all he ever needed to know. He wanted someone to make it easier for him, but he chose to do it in a rant. He had his mind made up about what SQL could and could not do. Rather than have the humility to simply ask "What am I doing wrong? Is there a better way?", he chose to be rude because surely anyone who disagreed with him would have to be narrow-minded and/or stupid.

    That's an immature ego talking. Hopefully, he will outgrow it in a year or two.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • foxjazz (3/14/2009)


    Instead of having you guys try and figure out some problem without the use of cursors, I have already made my point without realizing that I had.

    Simply because cursors are part and parsel of t-sql is that a good thing?

    Would t-sql be made better without cursors?

    Can you do all things necessary to a sql database without the use of cursors?

    If the question is yes, then they should have dated them. No new t-sql querys may be made with cursors should be the rule.

    If it is false, and cursors exist to perform a significant function within the t-sql camp, even though they are "bad" and shouldn't be used, it is inately a flaw in the software.

    I haven't experienced a case where I could write a stored proc, without t-sql language. If anyone knows how to do this, please let me know. I would love to write my stored procs in c#. But since no one has spoken up on this, I am going to assume for the moment it isn't possible.

    Why no one but me, is complaining about this is beyond my understanding.

    I don't follow you. You want to write SQL stored procs, without using SQL? Isn't that kind of like wanting to write web apps without using a language designed for that?

    You write procs in SQL, you write web apps in C#. You don't write web apps in SQL or procs in C# (without CLR, of course).

    As I mentioned several days ago, if this actually matters to you that much, DON'T USE SQL SERVER. Give one of the OODBMSs a try. Cache is built for accessing your database purely in .NET (or JAVA and a couple of others). It will do exactly what you want in the way you want. The trial version is free and has all the functions of the full version, you just aren't licensed to use it in production systems.

    You've been presented with a variety of solutions to your problem, but you keep on whining. The reason other people are acting in a way that's beyond your understanding is because they are comfortable with what you aren't comfortable with.

    From where I'm sitting, you're doing the equivalent of complaining about Laz-y-boy recliners, because they startle you when they suddenly lean back. If that's the case, get a non-recliner chair, but don't attack the people who like recliners.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 91 through 105 (of 465 total)

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