Insert selected values to table
Hi have stored procedure where i select values and want insert into table
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 in table :
INSERT INTO reports VALUES
(NULL,@uid,@subject,@body,@report_format,100,@report_serno,0,NULL,10,GETDATE())
In select I have 5 values , but when I insert to another table onle
inserted last selected value, I want insert to table all values what i
have in my select, how do this without cursos?
No comments:
Post a Comment