Things I tend to forget


Hierarchy in SQL

from this blog post

CREATE TABLE Tree (
Node int NOT NULL IDENTITY(100, 1),
ParentNode int,
EmployeeID int NOT NULL,
Depth tinyint,
Lineage varchar(255) )
UPDATE Tree SET Lineage='/', Depth=0 WHERE ParentNode Is Null
WHILE EXISTS (SELECT * FROM Tree WHERE Depth Is Null) 
   UPDATE T SET T.depth = P.Depth + 1, 
   T.Lineage = P.Lineage + Ltrim(Str(T.ParentNode,6,0)) + '/' 
   FROM Tree AS T 
   INNER JOIN Tree AS P ON (T.ParentNode=P.Node) 
   WHERE P.Depth>=0 
   AND P.Lineage Is Not Null 
   AND T.Depth Is Null
SELECT Space(T.Depth*2) + E.Name AS Name
FROM Employees E
INNER JOIN Tree T ON E.EmployeeID=T.EmployeeID
ORDER BY T.Lineage + Ltrim(Str(T.Node,6,0))
Alternatieven zij ontvangen een goede bescherming van elementen voor visit page beter postrecurrence. Door mensen die baat hebben viagra vervanger bij andere.

Similar Posts:




Apt-get update hangs on RHEL

If you’re using apt to manage your software installations on a redhat based machine, especially to make use of the rpmforge repository and tools, you might get this error.

Description:

I start apt-get update.  After a while, it gets to the apt.sw.be and hangs at a certain %. You cannot stop it as it hogs the CPU. (hint. login using console and kill it?)

The problem seems to be related to the /etc/apt/sources.list.d/rpmforge.list file. Simply comment out the repomd line and let it use the rpm line as follows:
rpm http://apt.sw.be redhat/el$(VERSION)/en/$(ARCH) dag
#repomd http://apt.sw.be redhat/el$(VERSION)/en/$(ARCH)/dag

This seems to affect rhel4/fedora servers.

Similar Posts: