T-SQL Tutorial

Binary - TSQL Tutorial


On Transact SQL language the binary is part of binary data types and have fixed length.
The string length must be a value from 1 through 8,000.

Binary syntax:

binary [ ( n ) ]

Binary example:

USE model;
GO
DECLARE @myVar BINARY(2);
SET @myVar = 12345678;
SET @myVar = @myVar + 2;
SELECT CAST( @myVar AS INT);
GO

Results
24912