SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating Tables


Creating Tables

Author
Message
Tom Thomson
Tom Thomson
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: General Forum Members
Points: 84360 Visits: 13220
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

Tom Thomson
Tom Thomson
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: General Forum Members
Points: 84360 Visits: 13220
john.arnott (2/13/2013)
[quote]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

Rich Mechaber
Rich Mechaber
SSCrazy Eights
SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)

Group: General Forum Members
Points: 8643 Visits: 3700
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
pchirags
pchirags
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4353 Visits: 617
Nice and Easy question..
Thanks..
crazy_s245 21087
crazy_s245 21087
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 35
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?
Roshan Jospeh
Roshan Jospeh
SSCrazy Eights
SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)

Group: General Forum Members
Points: 8853 Visits: 2120
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
sqlcentral-bugmenot
sqlcentral-bugmenot
SSC-Enthusiastic
SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)

Group: General Forum Members
Points: 108 Visits: 39
Just do this in a binary collation and the "in one batch" issue no longer matters.
SQL-DBA-01
SQL-DBA-01
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27631 Visits: 3906
good one

Thanks.
SQL-DBA-01
SQL-DBA-01
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27631 Visits: 3906
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search