当我的查询中有多个错误,并且我在 catch 块中使用try catch
and函数时,我只会收到最后一条错误消息。error_message()
例如,如果我的错误是:
Msg 2714, Level 16, State 5, Line 14
There is already an object named 'IX_EntityTypeConfigs' in the database.
Msg 1750, Level 16, State 1, Line 14
Could not create constraint or index. See previous errors.
Run Code Online (Sandbox Code Playgroud)
在 catch 块中我刚刚得到:
Could not create constraint or index. See previous errors.
Run Code Online (Sandbox Code Playgroud)
我怎样才能得到完整的消息?
我搜索了一下,发现这是 SQL Server 的限制,但文章属于 2014 年及之前的版本。
我想知道从那以后情况是否发生了变化。
我有两个容器。两者是相同的。两者都是使用两个不同服务器上的相同docker-compose.yml
文件启动的。两者具有相同的数据。完全相同(一个在另一个中备份并恢复)。
然而,对于同一查询,我得到了不同的排序。
这是我的查询:
SELECT `i`.`Id`,
`i`.`Guid`,
`i`.`Key`,
`i`.`Name`,
`i`.`Order`,
`i`.`PartTypeId`,
`i`.`PartTypeKey`,
`i`.`SectionId`,
`i`.`SectionKey`
FROM `ItemPartViews` AS `i`
WHERE `i`.`SectionId` = 7
ORDER BY `i`.`Order`
Run Code Online (Sandbox Code Playgroud)
这些是结果的图像:
我不明白为什么我会得到不同的排序。任何解释表示赞赏。