过程插入临时表 [英] Procedure insert into temp table

查看:67
本文介绍了过程插入临时表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

一个简单的谷歌搜索 [ ^ ]会告诉你什么是错的。

是的,SQL不支持在Insert语句中执行语句。



有很多方法可以达到你想要的效果。谷歌链接有很多讨论已经讨论过解决方案。

检查出来,如果这没有用,请告诉我们。
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.


这篇关于过程插入临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆