Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating Tables


Creating Tables

Author
Message
TomThomson
TomThomson
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10711 Visits: 12013
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

TomThomson
TomThomson
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10711 Visits: 12013
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
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1087 Visits: 3661
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
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2166 Visits: 613
Nice and Easy question..
Thanks..
crazy_s245 21087
crazy_s245 21087
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 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?
joeroshan
joeroshan
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1053 Visits: 1987
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 Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 37
Just do this in a binary collation and the "in one batch" issue no longer matters.
SQL-DBA-01
SQL-DBA-01
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2331 Visits: 3180
good one

Thanks.
SQL-DBA-01
SQL-DBA-01
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2331 Visits: 3180
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