Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有两个表的部门,员工部门的 DepID 是 Primarykey ,而 DepID 是 Employee 表中的外键。我想一次将 Asp.Net 应用程序中的数据插入两个表中。如何获取主键值 DepID要插入外键员工表的部门?
您是否尝试运行“SELECT SCOPE_IDENTITY()”查询以获取插入后的最后一个 ID?