This is a common issue when attempting to ‘bubble’ up data from a chain of stored procedures. A restriction in SQL Server is you can only have one INSERT-EXEC active at a time. I recommend looking at How to Share Data Between Stored Procedures which is a very thorough article on patterns to work around this type of problem.
For example a work around could be to turn Sp3 into a Table-valued function.
Related Posts:
- Rename column SQL Server 2008
- Efficiently convert rows to columns in sql server
- T-SQL split string based on delimiter
- How can I truncate a datetime in SQL Server?
- SQL Server Insert if not exists
- SQL Server: Invalid Column Name
- Determine ROW that caused “unexpected end of file” error in BULK INSERT?
- Determine ROW that caused “unexpected end of file” error in BULK INSERT?
- Microsoft OLE DB Provider for SQL Server error ‘80004005’
- Bulk load data conversion error (truncation)
- Backup a single table with its data from a database in sql server 2008
- How can I group by date time column without taking time into consideration
- Filter data based on date in sql
- Varchar invalid for Sum operator
- LIKE vs CONTAINS on SQL Server
- Case in Select Statement
- What is a stored procedure?
- Self Join to get employee manager name
- How do I UPDATE from a SELECT in SQL Server?
- SQL query to select dates between two dates
- Conversion failed when converting date and/or time from character string while inserting datetime
- error, string or binary data would be truncated when trying to insert
- NOT IN vs NOT EXISTS
- How can I do an UPDATE statement with JOIN in SQL Server?
- Must declare the scalar variable
- Must declare the scalar variable
- INSERT statement conflicted with the FOREIGN KEY constraint – SQL Server
- INSERT statement conflicted with the FOREIGN KEY constraint – SQL Server
- SQL Server Management Studio, how to get execution time down to milliseconds
- How to rename a table in SQL Server?
- Drop a temporary table if it exists
- How do I escape a single quote in SQL Server?
- How Stuff and ‘For Xml Path’ work in SQL Server?
- IDENTITY_INSERT is set to OFF – How to turn it ON?
- An attempt was made to access a socket in a way forbidden by its access permissions
- Update statement to update multiple rows
- Can a foreign key be NULL and/or duplicate?
- Why does NULL = NULL evaluate to false in SQL server
- Import / Export database with SQL Server Server Management Studio
- Difference between JOIN and INNER JOIN
- Best way to do nested case statement logic in SQL Server
- The multi-part identifier could not be bound
- “CASE” statement within “WHERE” clause in SQL Server 2008
- Get day of week in SQL Server 2005/2008
- Each GROUP BY expression must contain at least one column that is not an outer reference
- incorrect syntax error CREATE VIEW must be the only statement in the batch
- Attach (open) mdf file database with SQL Server Management Studio
- SQL Server WITH statement
- Conversion of a varchar data type to a datetime data type resulted in an out-of-range value in SQL query
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- How can I get column names from a table in SQL Server?
- How do I do multiple CASE WHEN conditions using SQL Server 2008?
- SQL Server reports ‘Invalid column name’, but the column is present and the query works through management studio
- How to parse XML data in SQL server table
- SQL Server IF NOT EXISTS Usage?
- Remote table-Valued Function Calls are not allowed
- How do you create a yes/no boolean field in SQL server?
- Arithmetic overflow error converting numeric to data type numeric
- What is the Oracle equivalent of SQL Server’s IsNull() function?
- MS SQL compare dates?
- MS SQL compare dates?
- I want to use CASE statement to update some records in sql server 2005
- The backend version is not supported to design database diagrams or tables
- How do I fix ‘Invalid character value for cast specification’ on a date column in flat file?
- Sql query to insert datetime in SQL Server
- What is the maximum characters for the NVARCHAR(MAX)?
- SELECT DISTINCT on one column
- Exclude a column using SELECT * [except columnA] FROM tableA?
- Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 4 (Year)
- Why is SQL server throwing this error: Cannot insert the value NULL into column ‘id’?
- TSQL PIVOT MULTIPLE COLUMNS
- SQL “select where not in subquery” returns no results
- ListAGG in SQLSERVER
- Equivalent of Oracle’s RowID in SQL Server
- Is there a Max function in SQL Server that takes two values like Math.Max in .NET?
- Regex pattern inside SQL Replace function?
- sql query to return differences between two tables
- Subtract one day from datetime
- ‘CREATE PROCEDURE’ must be the only statement in the batch (Erro)
- Is it possible to specify condition in Count()?
- Incorrect syntax near ”
- SQL Server: Make all UPPER case to Proper Case/Title Case
- How do I query for all dates greater than a certain date in SQL Server?
- Conditional JOIN Statement SQL Server
- Temporary table in SQL server causing ‘ There is already an object named’ error
- How to calculate age (in years) based on Date of Birth and getDate()
- Solutions for INSERT OR UPDATE on SQL Server
- Text was truncated or one or more characters had no match in the target code page including the primary key in an unpivot
- What datatype should be used for storing phone numbers in SQL Server 2005?
- Arithmetic overflow error converting varchar to data type numeric. ’10’ <= 9.00
- How to select the last record of a table in SQL?
- SHOWPLAN permission denied in database ‘tempdb’. in sql server 2008
- Append table to an existing one: SQL Server
- SQL Server – An expression of non-boolean type specified in a context where a condition is expected, near ‘RETURN’
- “select * into table” Will it work for inserting data into existing table
- INSERT VALUES WHERE NOT EXISTS
- CASE IN statement with multiple values
- Update query using Subquery in Sql Server
- How to connect to database from Unity
- How to dump a Microsoft SQL Server database to a SQL script?