Creating Tables

  • Dave62 (2/12/2013)


    I must say that a large majority of your posts I find educational.

    Thanks! That is what I normally try to achieve here.

    As to that previous post ... with hindsight, I now think I should have hit the browsers close button instead of the post button after writing it out and getting it off my chest. But that insight has come too late.

    My apologies to anyone who might feel offended.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (2/12/2013)


    In my opinion, positive posts ("great question!"), negative posts ("you suck!") and whining posts ("give me my point") are all an utter waste of bandwith, and I suspect most of the people who regularly write posts like that of doing it for the sole purpose of accumulating points.

    For the sole purpose of accumulating a point I have to agree with you.

    Just kidding Hugo. We greatly appreciate your contribution to these discusssions.

  • What Hugo said.

  • L' Eomot Inversé (2/12/2013)


    ... When wearing my mathematician hat I used to hate it when people got careless like that with numerical data, but these days I no longer worry about it, just point it out when it seems appropriate to do so.

    Tom, you have a lot of interesting theories about my intent for the last 2 buckets but the simple explanation is that it was to try and make a correlation with the 1st 2 buckets. The 1st 2 buckets are about as straight forward as you can get - Correct and Incorrect. It didn't take much of a mathematician's hat to see at the time of my post they were at 67% and 33%. The last 2 buckets may have been loosely labeled but it's easy to count that there have been more positive than negative posts. Correlation confirmed.

    By the way I also appreciate your extensive knowledge and contributions here. I find some of your posts educational, some entertaining, and some are both.

    Enjoy!

  • Hugo Kornelis (2/11/2013)


    . . . . The option "Only the 1st and 3rd statement will succeed but no rows will be returned", though technically not 100% accurate (as the 4th statement will also succeed), comes close enough to be considered te correct answer.

    I threw my dart to pick one of the two options, and failed. Oh well.

    I know I'm late to this party, but have to ask. What 4th statement? I see a Create Table, a Select Into and then a Select. Was the original code edited between publication and today?

  • Dave62 (2/13/2013)


    By the way I also appreciate your extensive knowledge and contributions here. I find some of your posts educational, some entertaining, and some are both.

    Enjoy!

    Well, I try to be educational, but with Gail and Hugo and Jeff and Paul posting with far more understanding of SQL Server that I have (or ever expect to have) I suspect that I'm a bit of a failure.

    Tom

  • john.arnott (2/13/2013)


    I know I'm late to this party, but have to ask. What 4th statement? I see a Create Table, a Select Into and then a Select. Was the original code edited between publication and today?

    The third statement was actualluy two statements (a select statement and a drop statement) so Hugo counted them as two, not one. Seems reasonable to me.

    edit: 's i litreachadh beurla thar comas agam - I can't spell English without an edit!

    Tom

  • Hugo Kornelis (2/11/2013)


    I'm surprised you didn't know this. Integer is actually the official name; int is an accepted abbreviation.

    *cough* I have to retract the above. That's what I always thought, but when I went out to find a Books Online reference, I was surprised to see only "int" there. "Integer" is not even mentioned. :unsure:

    EDIT: Found the source of my confusion. The ANSI documents describing the SQL standard define both INT and INTEGER, and describe INT as "equivalent to INTEGER". I've always interpreted that as "INTEGER" being the official form and "INT" being an accepted alternative.

    And that is one more reason why I value your posts, Hugo: you're honest enough to give us your initial, erroneous thought and then the reason reality is different. I often find that I learn more from articles, posts, blogs, etc. when the author is able to walk me along through their train of thought, even if there are discovered errors along the way.

    Thanks,

    Rich

  • Nice and Easy question..

    Thanks..

  • This code works in SQL 2005 and returns the inserted row, only there was error "Column, parameter, or variable #4: Cannot find data type Date". Same code didn't work in SQL 2012.

    Can any one please explain why this code worked in SQL 2005?

  • crazy_s245 21087 (2/19/2013)


    This code works in SQL 2005 and returns the inserted row, only there was error "Column, parameter, or variable #4: Cannot find data type Date". Same code didn't work in SQL 2012.

    Can any one please explain why this code worked in SQL 2005?

    If you haven't found the answer already,

    the create table part didnot execute in 2005 (since the date datatype is invalid) so the table got created with the select into statement.

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Just do this in a binary collation and the "in one batch" issue no longer matters.

  • good one

    Thanks.

  • But it is being asked to run the entire script at a single one. I'm sure this portion of the string was excess

    Thanks.

Viewing 14 posts - 46 through 58 (of 58 total)

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