Description
What is an "orphan project"? It is the result of a project OWNER being deleted therefore, when you attempt to add a project, it fails and you probably don't see all the projects on your list that you should.
Solution
Run the first script to confirm the fact that you have an orphan.
SELECT *
FROM Projects
WHERE OwnerID NOT IN (SELECT UserID FROM Users)
Note the ProjectID(s) in the results pane, for our example below it was identified as 130.
Determine the UserID you want to assign it to by running this snippet.
SELECT * FROM Users WHERE FirstName = 'Lora'
Note the UserID(s) in the results pane, for our example below it was identified as 2.
Run the following script after you determined the ProjectID and new Project Owner's UserID.
UPDATE Projects
SET OwnerID = 2
WHERE ProjectID = 130
Revised 02-26-2015
Comments
0 comments
Please sign in to leave a comment.