Ok.First -- can you redesign this? What happens in the future if you want more than 4 engineers assigned to a project?In a normalised design you'd have a simple table strucutre like this:TABLE Engineers ( [EngineerID] , [EngineerName] )TABLE Project ( [ProjectID] , [ProjectName] )TABLE EngneerProjectAssignment ( [ProjectID] , [EngineerID] )
If you built that structure then your query would be very, very easy.Here's a horrible piece of SQL that gives you wat you are looking for though SELECT [eng1] AS [Engineer], [Proj] AS [Project] FROM projectDetails WHERE [eng1] IS NOT NULLUNION SELECT [eng2] AS [Engineer], [Proj] AS [Project] FROM projectDetails WHERE [eng2] IS NOT NULLUNION SELECT [eng3] AS [Engineer], [Proj] AS [Project] FROM projectDetails WHERE [eng3] IS NOT NULLUNION SELECT [eng4] AS [Engineer], [Proj] AS [Project] FROM projectDetails WHERE [eng4] IS NOT NULL
Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION