查询中的表名太多。允许的最大值为256 [英] Too many table names in the query. Maximum allowable is 256

查看:176
本文介绍了查询中的表名太多。允许的最大值为256的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在sql 2005中对多个批次执行了以下查询,我收到的错误是查询中的表名太多。最大允许值是256。但在sql 2008中我得到了完美的输出。解决这个问题的方法是什么?



这是我的查询以下



Hi,

I have executed this following query for multiple batches in sql 2005, I am getting error as "Too many table names in the query. Maximum allowable is 256". but in sql 2008 I am getting the perfect output. Any solution for this problem?

Here is my query follows

SELECT DISTINCT c.FacName as Faculty_Name,(SELECT top 1 CAST(AVG(CAST(b.FacQ1 AS DECIMAL(10, 2))) / 5 * 100 AS decimal(10, 2)) from Tb_Presea_Feedback as a, Tb_Presea_Faculty_Feedback as b, Tb_Presea_Faculty_Master as c1 where a.Entereddate BETWEEN '10/27/2014 12:00:00 AM' AND '12/20/2014 12:00:00 AM' and a.FeedbackId=b.FeedbackId and c1.Facid=c.Facid and c1.Facid=b.FacId and c1.Active='A' and a.Batchid='B10665') as FacQ1, (Select top 1 CAST(AVG(CAST(b.FacQ2 AS DECIMAL(10, 2)))  / 5 * 100 AS decimal(10, 2)) from Tb_Presea_Feedback as a, Tb_Presea_Faculty_Feedback as b, Tb_Presea_Faculty_Master as c1 where a.Entereddate BETWEEN '10/27/2014 12:00:00 AM' AND '12/20/2014 12:00:00 AM' and a.FeedbackId=b.FeedbackId and c1.Facid=c.Facid and c1.Facid=b.FacId and c1.Active='A' and a.Batchid='B10665') AS FacQ2, (Select top 1 CAST(AVG(CAST(b.FacQ3 AS DECIMAL(10, 2))) / 5 * 100 AS decimal(10, 2)) from Tb_Presea_Feedback as a, Tb_Presea_Faculty_Feedback as b, Tb_Presea_Faculty_Master as c1 where a.Entereddate BETWEEN '10/27/2014 12:00:00 AM' AND '12/20/2014 12:00:00 AM' and a.FeedbackId=b.FeedbackId and c1.Facid=c.Facid and c1.Facid=b.FacId and c1.Active='A' and a.Batchid='B10665') AS FacQ3,





谢谢

Sudha



Thanks
Sudha

推荐答案

阅读本文: http://stackoverflow.com/questions/2432/have-you-ever-encountered-a-query-那个-sql-server-could-not-execute-because-it-r [ ^ ]


这篇关于查询中的表名太多。允许的最大值为256的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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