Is it possible to insert a unique id with sum() I have a 2 sproc first sproc go something like this. declare @p_Project_ID int, @Indentity1 int insert into Projects(Project_ID, ProjectName, ProjectNumber)--@@Identity(Project_id);store it in local values(52, 'MEDical start1', '5465464546541')set @p_Project_ID = @@IDENTITYinsert into PersonnelSummary (Date, Cleveland_Resident, DailyWork, Employee_Name, Gender, Minority, Position, Present, SubContractor, Project_ID, TradeContractor)values (04/02/2010, 1, 'woking', 'testing', 'male', 'yes', 'woking', 1, 'shelyb', @@IDENTITY, 'shelby')insert into Narrative (Date, ContructionManager, Location, MonitorSummary, MIM, MIF, MAF, MAM, Project_ID)Values (04/02/2010, 'tomas', 'cmc', 'testing1', 4,5,4,5, @p_Project_ID)
second insert into dbo.Manpower(Minority_Employees, Female_Employees, Total_Employees, Cleveland_Residents)Select SUM(Narrative.MIM),Sum(Narrative.MIF), SUM(Narrative.MAF + Narrative.MAM + Narrative.MIF + Narrative.MIM), SUM(PersonnelSummary.Cleveland_Resident)from Narrative, PersonnelSummary,
which displays in show table page. The problem I have a Project_ID int not null column in all the tables. The first one insert the Project_ID in all the tables it works perfectly except when it the same id i get an error.I need for it to place the Project_ID from the Narrative.Project_ID into the Manpower.Manpower_IDPlease if you can not give me an example don't respond to this plea for help.I work off example.which displays in show table page. The problem I have a Project_ID int not null column in all the tables. The first one insert the Project_ID in all the tables it works perfectly except when it the same id i get an error.