sp_executesql invalid object name
You are doing it wrong!
Try:
exec(@SQL)
instead of:
EXECUTE sp_executesql @SQL
To use sp_executesql the variable must be inside @SessionID the quotes and it must be provided has input parameter. Check this for a full example!
You've to be aware that Dynamic SQL is a good port for SQL injections!
The temp table is out of scope after exec is done.'exec' or 'sp_executesql' are run in thier own scope.
Thus anything created like temp tables and variables are destroyed or out of scope as soon as execution is over .Think these like stored proc.
To fix the issue.Create the temp table in main code.. then insert into it using dynmic sql and then read it in main code.
sp_executesql invalid object name的更多相关文章
- Recompile the invalid object for oracle.
1. How does the invalid object come? The Oracle database will invalidate objects if a dependent obje ...
- Invalid object name ‘sys.configurations’. (Microsoft SQL Server, Error: 208)
http://blogs.msdn.com/b/ramaprasanna/archive/2009/09/16/invalid-object-name-sys-configurations-micro ...
- MacTex XeLaTex xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object. 报错的解决方法
在使用MacTex配合TexStudio编译beamer的时候,爆出如下错误, xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object. 结果尝试其 ...
- Oracle EBS 重新编译无效对象 invalid object
1. 查看数据库中的无效对象 check oracle object SQL> select count(*) from dba_objects where status= ...
- sql - Invalid object name 'dbo.in$'
这是我从excel导入的表,用查询的时候,不加前面部分的'dbo',能查出来,好像是owner的原因吧.
- oracle impdp ORA-02304 invalid object identifier literal
reference: https://webgeest.blogspot.com/2015/07/ora-39083-ora-02304-on-impdp-datapump.html 解决方法 ...
- 讨论贴:在sp_executesql 中生成的临时表的可见性
首先创建数据表 IF object_id('TestTable') IS NOT NULL DROP TABLE TestTable GO ,),Info )) GO INSERT TestTable ...
- EXEC sp_executesql with multiple parameters
传递多个参数 https://stackoverflow.com/questions/28481189/exec-sp-executesql-with-multiple-parameters http ...
- [terry笔记]IMPDP报错ORA-39083 Object type TYPE failed to create ORA-02304
今天在使用impdp导入的时候(同一数据库中转换schema),遇到了 ORA-39083: Object type TYPE failed to create with error: ORA-023 ...
随机推荐
- Comparator 与 Comparable
转载自 http://www.cnblogs.com/sunflower627/p/3158042.html 1. Comparator 和 Comparable 相同的地方 他们都是java的一个接 ...
- vue 连接后台
在 index.js 中可以配置后台的地址:代理的方式: 这个文件在 config 中 proxyTable: { // 连接后台 '/api':{ target:"http://new.w ...
- phpstudy创建新站点-默认打不开
phpstudy中Apache中httpd.conf中如下语句前#要有 #Include conf/extra/httpd-vhosts.conf
- PHP 变量作用域
以下为 PHP 中的各种变量在底层实现中是如何存储的. 变量: $temp = 'temp'; $temp2 = $temp; // key p *executor_globals.symbol_ta ...
- 【BZOJ 1059】[ZJOI2007]矩阵游戏
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 最后要求对于所有的i,a[i][i]=1 那么,如果第i行的第j列为1. 就说明我们可以把这个第i行换到第j行. 因为这样的话,a[ ...
- POJ 3207 Ikki's Story IV - Panda's Trick(2-sat)
POJ 3207 Ikki's Story IV - Panda's Trick id=3207" target="_blank" style=""& ...
- java 短连接+MD5加密短链接
java 短连接+MD5加密短链接 import java.security.MessageDigest; public class ShotUrlUtil { public static void ...
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD
Build.VERSION.SDK_INT是系统的版本,Build.VERSION_CODES.GINGERBREAD是版本号. 到VERSION.SDK_INT不禁诧异,这是何物?! 看API的定义 ...
- bzoj2127: happiness(双倍经验最小割)
2127: happiness 题目:传送门 题解: 双倍经验美滋滋~ 请看蒟蒻以前写的渣题解...bzoj3894 表示做完自己就最小割了... 代码(直接改的...菜啊): #include< ...
- nodejs是什么
nodejs是什么 一种javascript的运行环境,能够使得javascript脱离浏览器运行. 阅读本帖需要先复习小学语文课文,华罗庚的<统筹方法>. 比如,想泡壶茶喝.当时的情况是 ...