INSERT ... EXEC
INSERT ... EXEC is a SQL statement in the DML Statements category. SQL Server: inserts the result of a stored procedure directly into a table. The syntax is INSERT INTO table EXEC stored_procedure params;. It returns rows inserted from proc. A typical example: CREATE TABLE #temp_employees (name VARCHAR(100), salary DECIMAL); INSERT INTO #temp_employees EXEC GetEmployeesByDept 'IT'; -- Inserts stored procedure results into temp table A close relative is INSERT INTO, which inserts new rows into a table. A close relative is UPDATE, which modifies existing rows in a table. Always use WHERE to avoid updating all rows. A close relative is DELETE, which removes rows from a table. Always use WHERE to avoid deleting all rows. More about this category: Data Manipulation Language — INSERT, UPDATE, DELETE, REPLACE, MERGE. Related DML Statements entries: INSERT INTO, UPDATE, DELETE, REPLACE INTO, INSERT ... ON DUPLICATE KEY UPDATE, MERGE, INSERT INTO SELECT, UPSERT (PostgreSQL).