0

I am new to sql. I have a stored procedure where I need to add two columns which is of Table "dbo.AdditionProjectDetails". Here ProjectID is the primary key. Below is the code snippet as I cant add the whole here. Any help?

    SELECT  PBD.Proj_ID, case when Phase =1 then 'Phase I' when Phase=2 then 'Phase II'
                    Tasktype,Area_Name,ProjectName,OS_Name,PTCDD.Remarks 
                     FROM ProjectDetails (NOLOCK) PBD
                    inner join ProjectTestProcessDetails (NOLOCK) PTPD on PBD.Proj_ID =PTPD.Proj_ID
                    inner join ProjectTestCycleDet (NOLOCK) PTCD on PTCD.Proj_ID=PBD.Proj_ID
                    inner join ProjectTestCycleDuration (NOLOCK) PTCDD on PTCDD.Proj_ID=PBD.Proj_ID
                    inner join ProjectTestProcessCostDetails (NOLOCK) PTPCD on PTPCD.Proj_Test_PrepareID=PTPD.Proj_Test_PrepareID
                    inner join AreaMaster Am on Am.Area_ID =PBD.AreaID
                    inner join ProjectMaster PM on PM.ProjectID =PBD.PlatformID
                    inner join OSMaster OS on OS.OS_ID =PBD.OSID

                    where Status in ('S','R','C') and Tasktype,Area_Name,ProjectName,OS_Name,PTCDD.Remarks
group by PBD.Proj_ID,PBD.Created_by,PBD.Created_on,status,TaskGivenDate
                    order by PTCD.TaskEndDate DESC
Ivan Cachicatari
  • 4,212
  • 2
  • 21
  • 41
beginner
  • 303
  • 1
  • 10
  • 31

1 Answers1

0

check this link here is the explaination of the store procedure and also details what u want

Insert results of a stored procedure into a temporary table

T-SQL How to create tables dynamically in stored procedures?

Community
  • 1
  • 1
hammad
  • 74
  • 3
  • 14