到目前为止我有这个代码:
DECLARE @AddressIDS TABLE
(
AddressID int
)
INSERT INTO Address(Street1, City, StateCode, ZipCode)
OUTPUT inserted.AddressID INTO @AddressIDS
SELECT Street1, City, StateCode, ZipCode
FROM Contact
现在我需要将 ID 放在表的@AddressIDS
后面。AddressID
Contact
这更好地描述了我在 TSQL 中尝试做的事情: