Re: Working With Binary Data Types



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)
.



Relevant Pages

  • Re: Executin DTSrun Utility under the xp_cmdshell
    ... package direct from Enterprise Manager; on the server or remotely, ... -Mike Gercevich ... Prev by Date: ...
    (microsoft.public.sqlserver.dts)
  • Enterprise Manager
    ... Is Enterprise Manager available as a separate download and installable on a ... Are there any similar third-party tools? ... Prev by Date: ...
    (microsoft.public.sqlserver.msde)
  • Pitch
    ... Reports that comes with SQL (Enterprise Manager)? ... Prev by Date: ...
    (microsoft.public.vb.crystal)
  • Re: Table right Click options missing
    ... MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging ... Prev by Date: ...
    (microsoft.public.sqlserver.clients)
  • Re: How do i search all Stored Procedures for a table name
    ... Query syscomments or use Enterprise Manager to script out all ... procedures to a file and just use simple find (Ctrl-F) ... Prev by Date: ...
    (microsoft.public.sqlserver)