我有 3 个表,Merchant_Master、Merchant_PaymentDetail 和 Merchant_refference 主表看起来像这样,ID 是自动增量
+----+------+------------+----------------+
| id | mid | acquirerID | merchantName |
+----+------+------------+----------------+
| 1 | 2345 | 3 | store 1 |
+----+------+------------+----------------+
Merchant_PaymentDetail 长这样,第一列是 AutoIncrement
+----+-----+--------+-------------+
| id | mid | BankID | AccountNo |
+----+-----+--------+-------------+
| | | | |
+----+-----+--------+-------------+
Merchant_Refference 表看起来像这样,第一列是 AutoIncrement
+----+-----+--------+---------------------+
| id | mid | Reference 1 | Reference 2 |
+----+-----+--------------+---------------+
| | | | |
+----+-----+--------------+---------------+
现在我想使用插入语句将记录插入到所有三个表中,但是如何从商家主表到其他两个表中获得相同的中间值(中间不是自动增量),我是否必须使用 @@IDENTITY 来实现这一点或者有没有其他方法。