我有一个存储过程,我在其中选择值并希望插入到表中
SELECT
@uid = arf.uid, @report_format = arf.report_format,
@report_serno = arf.report_serno
FROM
dbo.alert_report_format AS arf
INNER JOIN
dbo.users AS u ON arf.uid = u.serno
INNER JOIN
dbo.alert_reports AS ar ON arf.report_serno = ar.serno
插入表格:
INSERT INTO reports
VALUES (NULL, @uid, @subject, @body, @report_format, 100, @report_serno, 0, NULL, 10, GETDATE())
在选择中,我有 5 个值,但是当我插入另一个表时,仅插入最后一个选定的值,我想插入表中我在选择中拥有的所有值,如何在没有游标的情况下执行此操作?