Steve Jebson
asked on
select where image data type is null
What's the syntax for testing for image data type of null in a select where statement ?
When i execute a query in sql server it has 0x00 , which i believe is binary zero,
complete novice so you might need a bit of patience with me
thanks
Steve
When i execute a query in sql server it has 0x00 , which i believe is binary zero,
complete novice so you might need a bit of patience with me
thanks
Steve
ntext, text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead. For more information, see Using Large-Value Data Types on sql server books online.
ah, a 'select where' statement, then
select ID from myTable where myImage is null
=)
select ID from myTable where myImage is null
=)
ASKER
Except that doesn't return anything !
when i run a query that selects all and see the results in the results pane there's an 0x00 in the column, how do i test for that 'cos it appears that's not a Null but is it Binasry zero ?? if so how do i test against that ? when i select id where myImage=0 it gives me an error saying it can't test umage against tinyint
when i run a query that selects all and see the results in the results pane there's an 0x00 in the column, how do i test for that 'cos it appears that's not a Null but is it Binasry zero ?? if so how do i test against that ? when i select id where myImage=0 it gives me an error saying it can't test umage against tinyint
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
after converting,
select count(*) from myTable where ImageColumn = cast(0 as varbinary(max))
select count(*) from myTable where ImageColumn = cast(0 as varbinary(max))
ASKER
thanks, id di it the other way roun...Where Cast( [SignatureOfClient] as varbinary(max)) = 0
and thanks for other info, unfortuantely it's a db i've inherited so i can't go changing formats just yet.
thanks again.
and thanks for other info, unfortuantely it's a db i've inherited so i can't go changing formats just yet.
thanks again.
print 'myVar is null'