Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««23456

Creating Tables Expand / Collapse
Author
Message
Posted Wednesday, February 13, 2013 6:51 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:16 AM
Points: 8,548, Visits: 9,035
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
Post #1419791
Posted Wednesday, February 13, 2013 6:56 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:16 AM
Points: 8,548, Visits: 9,035
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
Post #1419792
Posted Friday, February 15, 2013 11:26 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Thursday, July 17, 2014 2:01 PM
Points: 687, Visits: 3,002
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.

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
Post #1420699
Posted Sunday, February 17, 2013 1:38 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, July 7, 2014 9:38 AM
Points: 1,780, Visits: 582
Nice and Easy question..
Thanks..
Post #1421005
Posted Tuesday, February 19, 2013 7:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, February 20, 2013 4:17 AM
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?
Post #1421912
Posted Tuesday, February 19, 2013 8:31 PM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 3:10 AM
Points: 615, Visits: 1,259
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
Custom cleanup script for backups
Post #1421916
Posted Tuesday, February 26, 2013 5:10 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, October 14, 2013 2:15 AM
Points: 32, Visits: 34
Just do this in a binary collation and the "in one batch" issue no longer matters.
Post #1424014
« Prev Topic | Next Topic »

Add to briefcase «««23456

Permissions Expand / Collapse