Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by bitbucket
»
T-SQL 2012 #2
30 posts, Page 1 of 3
1
2
3
»
»»
T-SQL 2012 #2
Rate Topic
Display Mode
Topic Options
Author
Message
bitbucket-25253
bitbucket-25253
Posted Saturday, January 12, 2013 12:32 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 5,102,
Visits: 20,205
Comments posted to this topic are about the item
T-SQL 2012 #2
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please
read
Before posting a performance problem please
read
Post #1406405
L' Eomot Inversé
L' Eomot Inversé
Posted Saturday, January 12, 2013 12:41 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 3:07 PM
Points: 7,096,
Visits: 7,156
Nice clear straightforward question.
Good to see a question on this new feature.
Interestingly, there's an error on the BoL page: it says the CHOOSE function
BoL
Returns the data type with the highest precedence from the set of types passed to the function
The first argument is an integer, which has a higher type precedence than any character type, but if it really was going to return an int we would have string to int conversion errors here. BoL should instead say that the return type is highest precedence type of the arguments other than the first.
Tom
Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
Post #1406406
bitbucket-25253
bitbucket-25253
Posted Saturday, January 12, 2013 1:45 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 5,102,
Visits: 20,205
L' Eomot Inversé (1/12/2013)
Nice clear straightforward question.
Good to see a question on this new feature.
Interestingly, there's an error on the BoL page: it says the CHOOSE function
BoL
Returns the data type with the highest precedence from the set of types passed to the function
The first argument is an integer, which has a higher type precedence than any character type, but if it really was going to return an int we would have string to int conversion errors here. BoL should instead say that the return type is highest precedence type of the arguments other than the first.
From the supporting link in the question
CHOOSE acts like an index into an array, where the array is composed of the arguments that follow the index argument. The index argument determines which of the following values will be returned.
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please
read
Before posting a performance problem please
read
Post #1406409
SQLRNNR
SQLRNNR
Posted Saturday, January 12, 2013 5:18 PM
SSCoach
Group: General Forum Members
Last Login: Monday, May 20, 2013 1:07 PM
Points: 18,733,
Visits: 12,332
Glad we have this feature added.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1406431
L' Eomot Inversé
L' Eomot Inversé
Posted Saturday, January 12, 2013 6:25 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 3:07 PM
Points: 7,096,
Visits: 7,156
bitbucket-25253 (1/12/2013)
L' Eomot Inversé (1/12/2013)
Nice clear straightforward question.
Good to see a question on this new feature.
Interestingly, there's an error on the BoL page: it says the CHOOSE function
BoL
Returns the data type with the highest precedence from the set of types passed to the function
The first argument is an integer, which has a higher type precedence than any character type, but if it really was going to return an int we would have string to int conversion errors here. BoL should instead say that the return type is highest precedence type of the arguments other than the first.
From the supporting link in the question
CHOOSE acts like an index into an array, where the array is composed of the arguments that follow the index argument. The index argument determines which of the following values will be returned.
Yes, it says that. But that says nothing about the type returned, it's about which value is selected before any necessary type conversion is done. The same page contains the incorrect statement that I quoted, which says nothing about which value is selected, only about which type it is to be converted to (which it gets wrong).
Tom
Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
Post #1406437
Lokesh Vij
Lokesh Vij
Posted Sunday, January 13, 2013 10:16 PM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 1:02 AM
Points: 1,174,
Visits: 1,250
Wow.. Thanks Ron for another one on SS2012
~ Lokesh Vij
Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions
Link to my Blog Post -->
www.SQLPathy.com
Follow me
@Twitter
Post #1406567
demonfox
demonfox
Posted Sunday, January 13, 2013 10:27 PM
Ten Centuries
Group: General Forum Members
Last Login: Saturday, May 18, 2013 6:46 PM
Points: 1,074,
Visits: 1,076
Lokesh Vij (1/13/2013)
Wow.. Thanks Ron for another one on SS2012
+1
Thanks for the question..
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one
Post #1406569
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
Posted Monday, January 14, 2013 12:05 AM
Hall of Fame
Group: General Forum Members
Last Login: Monday, May 20, 2013 3:48 AM
Points: 3,125,
Visits: 4,311
Interesting question, thanks Ron
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1406576
sqlnaive
sqlnaive
Posted Monday, January 14, 2013 12:06 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 2:36 AM
Points: 2,660,
Visits: 1,667
Thanks a lot for this question. Got to know about CHOOSE function. Very helpful.
Post #1406577
Koen Verbeeck
Koen Verbeeck
Posted Monday, January 14, 2013 1:28 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 1:21 AM
Points: 9,374,
Visits: 6,471
Great question about a new 2012 feature. Thanks Ron!
(and thanks for including me
)
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1406591
« Prev Topic
|
Next Topic »
30 posts, Page 1 of 3
1
2
3
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.