August 10, 2011 at 5:19 am
hello all.
I have one table with script:
CREATE TABLE [dbo].[ASS_Asset](
[ASS_AssetID] [bigint] NOT NULL,
[ASS_AssetParentID_fk] [bigint] NULL,
[ASS_AssetName] [nvarchar](200) NULL
CONSTRAINT [PK_ASS_Asset] PRIMARY KEY CLUSTERED
(
[ASS_AssetID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
this table has data,now I want to use hierarchy id functions on this table,is possible this?how can I do this?
August 10, 2011 at 2:41 pm
You seem to be missing the important part of the new datatype....your table doesn't have a HIERARCHYID column.
Try this article as a good start to understanding how this works.
_______________________________________________________________
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 Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
August 10, 2011 at 3:23 pm
My recommendation would be to skip the HierarchyID and go straight to "Nested Sets" which Joe Celko made famous.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply