通过存储过程发送大变量的权限 (SQL Server)

发布于 2024-08-29 06:42:59 字数 234 浏览 2 评论 0原文

我想不出一种方法可以通过调用存储过程一次接收超过 4000 个字节。我在表中存储的图像每个大约 15 - 20 KB,但是在获取它们并将它们显示到页面上时,它们的大小始终恰好是 3.91 KB(或 4000 字节)。

存储过程对一次可以发送的数据量有限制吗?我仔细检查了我的数据,确实只收到了 varbinary(MAX) 字段中的前 4000 个字符。

是否有权限设置允许一次超过 4k 字节?

I can't figure out a way to allow more than 4000 bytes to be received at once via a call to a stored procedure. I am storing images in the table that are around 15 - 20 kilobytes each, but upon getting them and displaying them to the page, they are always exactly 3.91 KB in size (or 4000 bytes).

Do stored procedures have a limit on how much data can be sent at once? I double-checked my data, and I am indeed only receiving the first 4000 characters from the varbinary(MAX) field.

Is there a permission setting to allow more than 4k bytes at once?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

凹づ凸ル 2024-09-05 06:42:59

您应该阅读使用大值数据类型

最大说明符扩展存储
varchar、nvarchar 的功能,
和 varbinary 数据类型。
varchar(最大值)、nvarchar(最大值)和
varbinary(max) 统称为
大值数据类型。您可以使用
要存储的大值数据类型
到 2^31-1 字节的数据。

大值数据类型类似
在对待较小的人的行为上
对应的 varchar、nvarchar 和
varbinary。

如果您无法传递超过 4000 字节,我会检查您的客户端应用程序,看看它是否限制或截断您的数据。 SQL Server 一次可以占用超过 4000 个字节。

编辑刚刚发现:

执行 (Transact-SQL)

使用带有字符串的 EXECUTE

在 SQL Server 的早期版本中,
字符串限制为 8,000 个
字节。这需要串联
用于动态执行的大字符串。
在 SQL Server 中,varchar(max) 和
nvarchar(max) 数据类型可以是
指定允许字符
字符串最大为 2 GB
数据。

You should read Using Large-Value Data Types

The max specifier expands the storage
capabilities of the varchar, nvarchar,
and varbinary data types.
varchar(max), nvarchar(max), and
varbinary(max) are collectively called
large-value data types. You can use
the large-value data types to store up
to 2^31-1 bytes of data.

The large-value data types are similar
in behavior to their smaller
counterparts, varchar, nvarchar and
varbinary.

If you can't pass more than 4000 bytes, I'd check in your client application to see if it is limiting or truncating your data. SQL Server can take more than 4000 bytes at one time.

EDIT just found this:

EXECUTE (Transact-SQL)

Using EXECUTE with a Character String

In earlier versions of SQL Server,
character strings are limited to 8,000
bytes. This requires concatenating
large strings for dynamic execution.
In SQL Server, the varchar(max) and
nvarchar(max) data types can be
specified that allow for character
strings to be up to 2 gigabytes of
data.

冰葑 2024-09-05 06:42:59

您需要使用不同的代码来访问 SQL Server 中的 BLOB。示例此处

You need to use different code to access BLOBs in SQL Server. Example here.

我喜欢麦丽素 2024-09-05 06:42:59

SQL Server 2005 中有一种称为“图像”的数据类型。您应该使用该数据类型来存储大型二进制对象,尤其是图像。

There is a data type called "image" in SQL Server 2005. You should use that data type to store large binary object especially images.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文