a good book on stored procedures

  • Could someone recommend a good book on SQL programming on Stored procedures, functions, triggers?

    I know there a lot of SQL queries books there, but would like particular how to write stored procedures, tricks, examples, logics?

    more intermediate level or advanced level?

    Thanks

  • With that, I'll ask you why do you want to limit yourself in such a fashion?  Even books that were written by the combined efforts of multiple authors are usually limited by chapter to only the knowledge and experience of the author that wrote the chapter (and, sad to say, they're sometimes terribly wrong even when written by well known authors).

    Yes, I agree... the internet is no better but at least you can find multiple opinions on the same subject.

    If you really want to learn, learn how to solve some real world problems.  Start answering questions (especially those you don't know the answer to) on this and other forums (although this is the best one, IMHO).

    Here's an example.  Take a look at the problem posted at https://www.sqlservercentral.com/forums/topic/join-how-to-get-only-the-first-row-from-the-left-table .  Don't look at the answers... just look at the original post.  Only one guy (but don't look at the other posts yet) on that post was even able to figure out what the poster was actually trying to accomplish.  Can you?  And then can you come up with an answer on your own?  Think about it and try it.  No cheating.  Only look at that first post that presents the problem.  Seriously... really try the problem even if it takes you a week.  Use any other resource you want to try to solve the problem but don't scroll down in that thread to see any of the possible answers.

    Also, the OP (Original Poster) said on that question was that doing such a thing as asked might save on transmission time.  Is the OP right?  Can you think of anything wrong with that?

    If you can't solve it in a week of good honest trying on your own, only then scroll down to see if there are any answers.  If there's more than one answer , setup the problem (the OP didn't provide a source of data... can you figure out what it is?) and see if you can improve on them especially in the area of accuracy of the return and performance.

    Books are great but, even if you try the examples in the book, the book will not provide you with the two things you need the most... the experience of trying to figure it out yourself and benefiting from the actions of more than one person.  Even seeing other peoples' questions for clarification on the problem are worth their weight in gold and, unless the author(s) of the book are very good at writing and understanding the human element of writing code, books cannot compare to finding and answering such questions.

    Another important thing about books is that some of the people who know the most about anything having to do with SQL Server and T-SQL have never written a book.  For example, have you been able to find a book written by Paul Randal, Kimberly Tripp, Brent Ozar (just to name a few) and dozens of other serious heavy hitters?  For those that did, were you able to find what you wanted to find (you already answered that and that's why you're asking for someone to recommend "a book")?

    If you want some good books to read about intermediate and advanced "tricks" in the things you asked, you could start off with the books written by Itzik Ben-Gan (whom I have a healthy respect for) and Grant Fritchey on the subject of execution plans.  But don't let those be your only source of study.  Find problems on this (especially) forum and other forms and start solving the problems.  It's going to require some time and dedication on your part but that will unexpectedly be returned in spades both personally and career wise. You'll be truly amazed at what you can teach yourself about SQL Server, T-SQL, and people.

    I can vouch for the method... it's how I got started and I've continued the same practice ever since I learned how to spell "SQL". 😀

    Heh... now go try that problem I posted the link for and solve it even if you already know how to do it and then answer the secondary question of is it a good idea or not to use it for cutting down on the number of bytes for data transmission and why.

    --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)

  • I'd suggest that you look at some of the Stairway articles on this site. All the ones I've read have been extremely  well-written. You can pick topics that cover areas you need to brush up on or just that you find interesting.

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

Viewing 7 posts - 1 through 6 (of 6 total)

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