与标识符长度有关的SQL错误消息

本文关键字:SQL 错误 消息 标识符 | 更新日期: 2023-09-27 18:14:48

我得到以下错误,但不太确定这是什么意思:

错误信息:System.Data.SqlClient.SqlException: The identifier that以'[DEFAULT], 1作为rowJoiner FROM (dasolPSDev.dbo.BB03_12)内部连接dasolPSDev.dbo。在dasolPSDev.dbo.BB03_12。Caseid = '太长了。最大长度为128。在System.Data.SqlClient.SqlConnection。OnError (SqlException异常,布尔值breakConnection) atSystem.Data.SqlClient.SqlDataReaderSmi.InternalNextResult(布尔ignoreNonFatalMessages)System.Data.SqlClient.SqlDataReaderSmi.NextResult ()System.Data.SqlClient.SqlCommand.RunExecuteReaderSmi (CommandBehaviorRunBehavior, RunBehavior,布尔返回流)atSystem.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehaviorRunBehavior, RunBehavior,布尔返回流,字符串方法,DbAsyncResult的结果)System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehaviorRunBehavior, RunBehavior,布尔返回流,字符串方法)System.Data.SqlClient.SqlCommand.ExecuteReader (CommandBehavior行为,字符串方法)System.Data.SqlClient.SqlCommand.ExecuteReader ()PowerStatTable.CentileGenerator。LoadResult(String strQry, Int32currRowNo)PowerStatTable.CentileGenerator。LoadMedianTable (OutputMatrix outMtx)在PowerStatTable.CentileGenerator.CaclulateMedian (CentileStdErrCalculator计算,Int32 prevCol, Int32 colIndex) atPowerStatTable.MedianGenerator.Start ()PowerStatTable.TableGenerator。开始(ApplicationContext appContextString strUID, Int32 seqId, Int32 flagProgress, String strTpf, Int32输出类型)在StoredProcedures。CreatePowerStatTable(主题是strUID,Int32 seqId, Int32 flagProgress, Int32 outputType)

128个字符的限制是什么?我正在使用c#和SQL Server 2005和编辑别人的代码。

与标识符长度有关的SQL错误消息

sysname数据类型最多128个字符。请注意,错误显示的是SQL命令的一部分,从[Default]开始。您正在编辑的进程正在生成无效的sql语句-它试图将整个文本视为字段或表名。返回并检查生成SQL语句的代码。

SQL Server认为您引用的对象名称为

'[DEFAULT], 1 AS rowJoiner FROM (dasolPSDev.dbo.BB03_12 INNER JOIN dasolPSDev.dbo.BB03_10 ON dasolPSDev.dbo.BB03_12.caseid = '

很明显,你并没有尝试那样做;因此,创建SQL语句的过程的某些部分没有正确设置