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
»
SQL Server 2008
»
T-SQL (SS2K8)
»
Data type precedency ntext and hierarchyid
Data type precedency ntext and hierarchyid
Rate Topic
Display Mode
Topic Options
Author
Message
Golfer22
Golfer22
Posted Tuesday, December 25, 2012 7:08 PM
SSC Journeyman
Group: General Forum Members
Last Login: Saturday, February 02, 2013 11:13 PM
Points: 82,
Visits: 76
Tinyint and bit have a higher precedence than ntext. Why is this? Couldn't ntext we complex alphanumeric values? Tinyint and bit are limited and simple.
What precedence does hieararchyid data type have? I looked here but didn't see anything: http://msdn.microsoft.com/en-us/library/ms190309.aspx
Post #1400118
Sean Lange
Sean Lange
Posted Wednesday, December 26, 2012 8:11 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 9:12 AM
Points: 8,556,
Visits: 8,209
Golfer22 (12/25/2012)
Tinyint and bit have a higher precedence than ntext. Why is this? Couldn't ntext we complex alphanumeric values? Tinyint and bit are limited and simple.
What precedence does hieararchyid data type have? I looked here but didn't see anything: http://msdn.microsoft.com/en-us/library/ms190309.aspx
You kind of have 2 or 3 questions here.
Why is tinyint a higher precedence than ntext? First of all ntext is deprecated so you shouldn't be using it at all. Your argument of it could be complex alphanumeric values is exactly why it fall on the precedence list where it is. You can't do math on alphanumeric values. They have to be numeric to perform calculations. The more relevant reason is that you have crossed the line from something that can be used in a mathematical equation to something that can't (well maybe it can IF the data can be converted).
Your second question is about the precedence of HierarchyID. My question would be, does it really matter? Are you going to be implicitly converting to/from the hierarchyID datatype?
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1400257
Golfer22
Golfer22
Posted Saturday, December 29, 2012 11:48 AM
SSC Journeyman
Group: General Forum Members
Last Login: Saturday, February 02, 2013 11:13 PM
Points: 82,
Visits: 76
I probably won't be converting to or from HierarchyId. I'm just curious. If someone wants to answer this thread for the theoretical fun, please do.
Post #1401197
« Prev Topic
|
Next Topic »
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.