x002548's Blog

Not Just a Number - Brett Kaiser
posts - 89, comments - 586, trackbacks - 39

July 2007 Blog Posts

Because you're mine, I walk the line

....ummm, well, that "line" would be walking through a line in a family tree.  I saw a post the other the day that asked, if I know a relative somewhere in a families "lineage", how can I find the entire family tree from top to bottom. Well here's a hack to do that...don't ask for effecienciey.  This for SQL Server 2000.  I have to determine if CTE's in 2k5 can come up with a better solution, but here it is for now. CREATE TABLE Parent (    ID_PK int IDENTITY(1,1)  , [Name] varchar(20)  , PhoneNum varchar(20)  , Address varchar(30)) CREATE TABLE Child (    ID_PK int  , ParentID_FK int) GO INSERT...

posted @ Thursday, July 26, 2007 3:45 PM | Feedback (4) | Filed Under [ SQL Server ]

Powered by:
Powered By Subtext Powered By ASP.NET