Need Help with Stored Procedure

  • CELKO (10/10/2014)

    Finally, we use lowercase for data types, because in SQL Server type names are case sensitive in many contexts. We do not want to cause unexpected future errors when code needs to be run on a case-sensitive instance or against a remote instance.

    Yes Microsoft is trying to fix this.

    Right, I'm sure they'll get right on that, if some future SQL release, which will still take many of us time to move to. But in the meantime, do you still demand "we" use upper-case and cause production abends because of "Bouma"??

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • CELKO (10/10/2014)

    Again, who the hell has used tape for anything but backups in 20 years?! At least join the 1990s if you can't all the way to 2014!

    A tape is sequential file structure; it is made of contiguous storage for records, the records are subdivided into fields. Access is done by a record number. The physical form is not important; the logical model is important. IDENTITY mimics the tape record number instead of a relational key, every temp table is a scratch tape in a bad disguise, etc.

    No; facile but wrong. A table does not have to read sequentially like tape. Identity is as good, convenient, practical way of assigning something like a sequential Order#. Thus, in those types of cases, "the physical form of [how that is done] is not important".

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Mr. Celko, I have I a request.

    Please either go away with extreme prejudice, or bring the personality that you (apparently, due to source I trust) have in real life to the internet. This version isn't working.

    We tire of this. Alright, forget the "we", "I" tire of this. You aggravate "me" (the internet) because of your ivory tower ideals, your constant advertisement of standards that you expect to get paid for, and your belligerent abuse of newbies.

    Why do I say that? You've seen for yourself the kind of responses you provoke, and rarely, if ever, is it "Thank you".

    Just... stop this. You're not adding to the discussion. You're not helping with 'hard teachers' or 'heavy handed instruction'. You've become "that guy". You are NOT helping, at least not on this site.

    Please stop. You obviously have a brain and from what I've been told an understanding of the human condition. Use it, please. I beg you.

    [Edited for clarity and something more obvious]


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • CELKO (10/10/2014)


    Identity is as good, convenient, practical way of assigning something like a sequential Order#.

    No it is not; we have the ANSI/ISO Standard CREATE SEQUENCE now. Funny you mentioning that; Italy and probably other countries require invoice numbers and other things be in order by law.

    Again, depends on what specific version of SQL you're on. Besides, SEQUENCEs can "lose" numbers as well: if the transaction rolls back, the acquired sequence number(s) cannot be put back in the pool. If, by law, you can't have any gaps in the assigned numbers, you'll need some other mechanism.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Anyone else feeling a bit sorry for OP? He's just starting out, asks a question and ends up in the middle of an esoteric sh1t-storm!

  • CELKO (10/20/2014)


    ..SEQUENCEs can "lose" numbers as well: if the transaction rolls back, the acquired sequence number(s) cannot be put back in the pool. If, by law, you can't have any gaps in the assigned numbers, you'll need some other mechanism.

    You use a procedure to save the discarded number then do the ROLLBACK, and finally insert a row for the voided transaction. It is a common idiom to keep the accountants happy -- a major part of IT ;-).

    Maybe, maybe not. Some errors can't be trapped and automatically fail the batch. You certainly couldn't reliably state this was done everywhere in the code it needed to be.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

Viewing 6 posts - 16 through 20 (of 20 total)

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