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


Data type precedency ntext and hierarchyid


Data type precedency ntext and hierarchyid

Author
Message
Golfer22
Golfer22
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 96
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
Sean Lange
Sean Lange
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16550 Visits: 17004
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
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Golfer22
Golfer22
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 96
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.
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