[英]SQL Server VARBINARY(MAX)
I have a stored procedure that inserts a varchar
& VARBINARY(MAX)
values in the table. 我有一个存储过程,可以在表中插入
varchar
和VARBINARY(MAX)
值。 I pass ac# byte[]
to the varbinary(max)
field. 我将ac#
byte[]
传递给varbinary(max)
字段。 I also see that the size of the byte[]
size is 80142 which satisfies the max limit of varbinary
. 我还看到
byte[]
size的大小是80142,它满足varbinary
的最大限制。 Stored procedure executes without any errors. 存储过程执行无任何错误。 But when I try to query that table I see empty values in the
varbinary
datatype. 但是,当我尝试查询该表时,在
varbinary
数据类型中看到空值。
SQL sp SQL sp
ALTER PROCEDURE [dbo].[Test]
-- Add the parameters for the stored procedure here
@PNumber varchar(50)
,@Byte varbinary(max)
AS
BEGIN
SET NOCOUNT ON;
-- Insert statements for procedure here
INSERT INTO [Test].[dbo].[Data]
([PNumber]
,[PByte])
VALUES
(@PNumber
,@Byte)
END
C# CODE C#代码
byte[] theData = doc.GetData();
DAL_DataTableAdapters.QueriesTableAdapter qta = new DAL_DataTableAdapters.QueriesTableAdapter();
qta.Test("test", theData);
Table structure: 表结构:
CREATE TABLE [dbo].[Data]
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[PNumber] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PByte] [varbinary](max) NULL
) ON [PRIMARY]
How do you determine that the data is empty? 您如何确定数据为空? I'm quite certain that SQL Server Management Studio will not display a value that is too long (I don't know the limit), even when the value is there.
我非常确定SQL Server Management Studio将不会显示太长的值(我不知道限制),即使该值在那里。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.