Sql:语句太长了 [英] Sql:statement is too long

查看:281
本文介绍了Sql:语句太长了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net网络应用程序中我收到此错误SQL:声明太长,如何解决它



可以帮助我。



我尝试了什么:



只是我想要出错的原因

In asp.net web app i getting this error"SQL:statement is too long how to fix it

can any one help me.

What I have tried:

just i want reason for that error

推荐答案

首先查看您正在使用SQL做什么 - 找出它产生错误的代码行(使用调试器)并找出它正在处理的SQL语句在你拥有它之前,你将无处可去。



最有可能的是,你试图连接字符串以形成一个SQL查询,并产生一个坏的(或过度的)如果是这样,请立即停止执行,并使用参数化查询。不仅您的问题可能会消失,而且您的代码将更具可读性,并且不会向SQL注释开放 - 用户所在的位置可能会损坏或破坏您的数据库。



但在您确定正在执行的生产线之前,我们可以甚至开始帮助你进一步建议google错误信息!
Start by looking at what you are doing with SQL - find out which line of code it generating the error (use the debugger) and find out exactly what SQL statement it is processing. Until you have that, you will get nowhere.

Most likely, you are trying to concatenate strings to form an SQL query, and that generates a bad (or excessively long) single query. If so, stop doing that immediately, and use parameterised queries instead. Not only will your problem probably go away, but your code will be more readable, and it won't be open to SQL Injection - where the user can damage or destroy your database.

But until you identify the actual line being executed, we can't even begin to help you further than suggesting "google the error message"!


嗯......



MSDN文档states:目标代码太长,无法编译。

请参阅: SQL:语句太长(错误1812) [ ^ ]



如果没有看到代码,我们将无法为您提供更多帮助。
Well...

MSDN documentation states: The object code is too long to be compiled.
See: SQL: Statement too long (Error 1812)[^]

We aren't able to help you more without seeing a code.


这篇关于Sql:语句太长了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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