Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
SQL
declare @SalaryCalc table(EmpID int,Employeecode varchar(50),Prd varchar(15),FYear int,
EmpName varchar(50),Designation varchar(25),Grade varchar(10))


insert into @SalaryCalc(empid,employeecode,prd,fyear,empname,designation,grad)
exec Sal_SalaryCalculation 1,'Oct-2012',187


Error
An INSERT EXEC statement cannot be nested
Posted
Updated 8-Aug-13 2:52am
v2

1 solution

A simple Google search[^] would have told you what's wrong.
Yes, SQL do not support executing a statement in an Insert statement.

There are many ways to achieve what you want. The Google link has lots of discussion which already discusses the solution.
Check them out and let us know if that doesn't help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900