I want to insert data into table using both select statement and executing procedures.
That is... suppose a table 'TEMP' has 4 columns A,B,C,D. A & B column values will be coming from SELECT statement and C, D column values will be come by executing any stored procedures.
I have tried following but didn't facing error.
INSERT INTO TEMP
SELECT R1.A, R1.B, R2.C, R2.D FROM
(SELECT A , B FROM SOME_TABLE) AS R1
CROSS JOIN EXEC [dbo].[SOME_PROCEDURE] @SOME_VARIABLE1 ) AS R2
ERROR IS:
Incorrect syntax near the keyword 'exec'