I need to come up with a data modle that will let me have elements in an "outline" like this:

<pre>1.0 Top-level element

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.1 Second Level element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.2 Second Level element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.2.1 Third Level element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.2.2 Third Level element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.3 Second Level element2.0 Top level element&nbsp;&nbsp;&nbsp;&nbsp;2.1 Second Level element&nbsp;&nbsp;&nbsp;&nbsp;2.2 Second Level element&nbsp;&nbsp;&nbsp;&nbsp;2.3 Second Level element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.3.1 Third Level Element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.3.2 Third Level Element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.3.2.1 Fourth Level element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.3.3 Third Level Element3.0 Top level element...

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</pre>

And so on. The catch is, unlike a forum , there is no way to sort the elements by date, and to make it even more fun, I have to be able to select an element, and move it up or down in the heirarchy. So if I move element 2.3 up, it becomes 2.2, and 2.3.1 becomes 2.2.1, etc. And of course 2.2 becomes 2.3, swapping the spots in the heirarchy.

I'm not sure if I made this clear. I appreciate ANY advice. Mostly what I'm looking for is a data model that will et me sort the elements in this way. I can then figure out the logic for moving them up and down, etc.

...And they also remove multiple spaces, so your indents are gone too. :)

There's a stored procedure listed in Books Online (search "Expanding Hierarchies") that would help you. It sounds like you are dynamically changing either the parent, and/or the order of parents and children, when you "move" them up or down. Whoa.

And I actually answered this question too. I've been wanting to write that code for quite a while now. You can read the article here (http://www.sqlteam.com/item.asp?ItemID=1602). It should show up on the site Thursday morning.