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


char to datetime!


char to datetime!

Author
Message
Toreador
Toreador
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2775 Visits: 8084
Cliff Jones (8/19/2009)
Mark Horninger (8/19/2009)
Actually, you could do an implicit or explicit conversion....




I agree. That was my first thought as well.


Me too. Since there was no 'either implicit or explicit' option, I got it right by a 50% guess :-)
GSquared
GSquared
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23545 Visits: 9730
The question doesn't actually ask what the author thinks.

I got it right, but only by trying to outthink the author.

None of the answers given were actually sequitur to the question.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Rob Goddard
Rob Goddard
Right there with Babe
Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)

Group: General Forum Members
Points: 720 Visits: 558
GSquared (8/19/2009)
The question doesn't actually ask what the author thinks.

I got it right, but only by trying to outthink the author.

None of the answers given were actually sequitur to the question.


Exactly what I thought when I was staring at the answers, frustrated that I had to take a wild stab in the dark before being able to post... Unfortunately I wasn't successful in my attempt to outthink the author.

--------
I love deadlines. I like the whooshing sound they make as they fly by. -Douglas Adams
Christopher Stobbs
Christopher Stobbs
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2442 Visits: 2233
I agree with the last two posts. I got it wrong cause I can't mind read.

I can think of many examples where the cast is not implicit...

----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley

w00t
Posting Best Practices
Numbers / Tally Tables

SQL-4-Life
TomThomson
TomThomson
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14328 Visits: 12197
Christopher Stobbs (8/24/2009)
I agree with the last two posts. I got it wrong cause I can't mind read.

I can think of many examples where the cast is not implicit...


Well, I disagree with those two posts and with you. Is the conversion from tinyint to int implicit, explicit, or forbidden? It's implicit. But as far as I can see you are telling me that because it is perfectly valid to write
declare @integer int
declare @octet tinyint
select @octet = 0
select @integer = cast (@octet as int)
the conversion from tinyint to int is explicit. Well, I think that's a very strange point of view.

The descriptions in BOL seem to me quite clear. In fact there's even a nice matrix showing which conversions are implicit, which explicit, and which forbidden. It's been there since SQL 2000. It's still there in SQL 2008 R2. [url=http://msdn.microsoft.com/en-us/library/ms187928%28SQL.105%29.aspx][/url]

Tom

rja.carnegie
rja.carnegie
SSC-Enthusiastic
SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)

Group: General Forum Members
Points: 121 Visits: 169
Incidentally I recently created a view around OPENQUERY() - data coming from a linked server. Which may have been not the best way to do what I was doing. But anyway, I thought it could be useful to name and CAST to type the columns of the OPENQUERY results - that is, to express explicitly outside the OPENQUERY term the expected columns. But is that worthwhile, or does it perhaps even create a problem?

I haven't been doing the problems lately because I realised if I pass on one that's too hard it doesn't count in the game, and my score looks better than it is. Like Who Wants to Be a Millionaire, I can look at the question and decide to ignore it and keep what I've got. Maybe the score system should keep count of that. I mean, I also don't want to guess, particularly on a point I don't currently understand but may need to at a later date.
kalyani.k478
kalyani.k478
Say Hey Kid
Say Hey Kid (678 reputation)Say Hey Kid (678 reputation)Say Hey Kid (678 reputation)Say Hey Kid (678 reputation)Say Hey Kid (678 reputation)Say Hey Kid (678 reputation)Say Hey Kid (678 reputation)Say Hey Kid (678 reputation)

Group: General Forum Members
Points: 678 Visits: 97
Toreador (8/19/2009)
Cliff Jones (8/19/2009)
Mark Horninger (8/19/2009)
Actually, you could do an implicit or explicit conversion....




I agree. That was my first thought as well.


Me too. Since there was no 'either implicit or explicit' option, I got it right by a 50% guess :-)


me 2Smile
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