Re: Working With Binary Data Types
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 May 2005 11:15:51 +0200
On Tue, 17 May 2005 07:10:04 -0700, Tom Glasser wrote:
>I am looking at a table, using Enterprise Manager, that has several fields
>defined
>as Binary. All I seem to be able to see is the literal "<Binary>" in these
>fields.
>How can I view the actual values in these fields? How do I do a selection
>criteria on them?
Hi Tom,
Use Query Analyzer instead of Enterprise Manager.
CREATE TABLE test
(a int NOT NULL PRIMARY KEY,
b varbinary(80) NOT NULL)
go
INSERT INTO test (a, b)
SELECT 1, CAST(123435 AS varbinary(80))
go
-- Display binary data
SELECT b
FROM test
WHERE a = 1
go
-- Selection based on binary data
SELECT a
FROM test
WHERE b = 0x0001E22B
-- or: WHERE b = CAST(12345 AS varbinary(80))
go
DROP TABLE test
go
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
.
- References:
- Working With Binary Data Types
- From: Tom Glasser
- Working With Binary Data Types
- Prev by Date: Re: A tree of location and site names..
- Next by Date: query multi tables, count/sum 1 of the tables
- Previous by thread: Working With Binary Data Types
- Next by thread: query multi tables, count/sum 1 of the tables
- Index(es):
Relevant Pages
|
|