sql将排序的最大字段长度是多少?对于varchar或nvarchar

时间:2022-01-16 16:54:47

Hey guys I thought I ran into something where sql would only sort up to a certain length of a varchar or nvarchar. Does anyone know that #?

嘿家伙我以为我碰到了一些东西,其中sql只能排序到一定长度的varchar或nvarchar。有谁知道#?

2 个解决方案

#1


4  

However, there is a limit of 8,060 bytes for the row size of intermediate worktables needed for sort operations. This limits the total size of columns specified in an ORDER BY clause.

但是,排序操作所需的中间工作表的行大小限制为8,060字节。这限制了ORDER BY子句中指定的列的总大小。

Ref.

参考。

If you are hitting that length, you have bigger problems!

如果你达到这个长度,你就会遇到更大的问题!

#2


1  

This is implementation dependent

这取决于实现

you can order by some (hashing, checksum, whatever) function (which reduces the size to sortable one) from column values being ordered

你可以通过一些(哈希,校验和,无论什么)函数(从缩小的大小减少到可排序的大小)来订购要排序的列值

#1


4  

However, there is a limit of 8,060 bytes for the row size of intermediate worktables needed for sort operations. This limits the total size of columns specified in an ORDER BY clause.

但是,排序操作所需的中间工作表的行大小限制为8,060字节。这限制了ORDER BY子句中指定的列的总大小。

Ref.

参考。

If you are hitting that length, you have bigger problems!

如果你达到这个长度,你就会遇到更大的问题!

#2


1  

This is implementation dependent

这取决于实现

you can order by some (hashing, checksum, whatever) function (which reduces the size to sortable one) from column values being ordered

你可以通过一些(哈希,校验和,无论什么)函数(从缩小的大小减少到可排序的大小)来订购要排序的列值