I have table that has several colums but only important ones are ID and Parent_ID.
I'd like to greate JOIN between two tables that returns every ID in table ordered so that after line that has Parent_ID = 0 there comes every single line that has Parent_ID equal ID to one that had Parent_ID = 0 (preferably sorted by date-field)
So if I've understood this correctly this is "zero or one or many" relationship to same table.
Everything should come out with single query because it would give me best performance.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes. We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…