sqlserver 操作binary和varbinary字段


sqlserver 操作binary和varbinary字段

USE [TSBLMS_7805]
GO

/****** Object:  Table [dbo].[aa]    Script Date: 2020/09/16 15:32:29 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[aa](
	[a1] [varbinary](max) NULL,
	[a2] [binary](50) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO



declare @a1 varbinary(50)
declare @a2 binary(50)

set @a1=cast('123' as varbinary(3)) + cast('456' as varbinary(3))
set @a2=cast('123' as binary(3))


insert into aa (a1,a2) values(@a1,@a2)
select a1,a2 from aa

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM