0

I have this table called DevProject which keeps track of developers who are affected to a particular project.

ID           int PK
DevID        int NOT NULL FK
ProjectID    int NOT NULL FK  

ID is the PK column for DevProject table. DevID and ProjectID are respectively PK in the Developers and Project tables. When A new project starts, a group of developers are affected to that project. Some of the developers might still be working on other projects. So, After the manager has decide whose going to work on a particular new project, the DevProject table should be populate with the ID of the new project and the ID of the developer.

Thanks for helping.

4

1 回答 1

1

我知道你的意思。那个链接有答案。

  declare @ID int;
  insert into table_1 (value) values ('newProj2');
  SET @ID = SCOPE_IDENTITY();
  insert into table_2 (id, memberID) values (@ID, 1);
  insert into table_2 (id, memberID) values (@ID, 2);
于 2012-10-11T19:31:01.100 回答