Home All Groups Group Topic Archive Search About

Check if image column is empty

Author
14 May 2005 1:11 AM
krygim
Currently I use the follow Select statement to test if a non-nullable image
column is empty and not null:
Select Case When Substring(ImageColumn,1,1)='' Then 1 Else 0 End As IsEmpty

Can any body show me a better way to check if a column (non-nullable column)
of image data type is empty.

Author
14 May 2005 1:29 AM
CBretana
DataLength(ColName) will be zero (0) if it's empty...

Show quote
"krygim" wrote:

> Currently I use the follow Select statement to test if a non-nullable image
> column is empty and not null:
> Select Case When Substring(ImageColumn,1,1)='' Then 1 Else 0 End As IsEmpty
>
> Can any body show me a better way to check if a column (non-nullable column)
> of image data type is empty.
>
>
>
Author
14 May 2005 1:36 AM
krygim
Thanks

Show quote
"CBretana" <cbretana@areteIndNOSPAM.com> wrote in message
news:380D392D-B82A-493E-AA22-C137F4599577@microsoft.com...
> DataLength(ColName) will be zero (0) if it's empty...
>
> "krygim" wrote:
>
> > Currently I use the follow Select statement to test if a non-nullable
image
> > column is empty and not null:
> > Select Case When Substring(ImageColumn,1,1)='' Then 1 Else 0 End As
IsEmpty
> >
> > Can any body show me a better way to check if a column (non-nullable
column)
> > of image data type is empty.
> >
> >
> >
Author
14 May 2005 1:33 AM
CBretana
Or, actually, just check if the column's value itself = '' (empty string)...
That should work.  you don't need to attempt to extract the first character
and test that...



Show quote
"krygim" wrote:

> Currently I use the follow Select statement to test if a non-nullable image
> column is empty and not null:
> Select Case When Substring(ImageColumn,1,1)='' Then 1 Else 0 End As IsEmpty
>
> Can any body show me a better way to check if a column (non-nullable column)
> of image data type is empty.
>
>
>
Author
14 May 2005 6:56 AM
krygim
I got the error message: "The text, ntext, and image data types cannot be
compared or sorted."



Show quote
"CBretana" <cbretana@areteIndNOSPAM.com> wrote in message
news:3ADDA38D-0AC0-4377-9933-182222F35875@microsoft.com...
> Or, actually, just check if the column's value itself = '' (empty
string)...
> That should work.  you don't need to attempt to extract the first
character
> and test that...
>
>
>
> "krygim" wrote:
>
> > Currently I use the follow Select statement to test if a non-nullable
image
> > column is empty and not null:
> > Select Case When Substring(ImageColumn,1,1)='' Then 1 Else 0 End As
IsEmpty
> >
> > Can any body show me a better way to check if a column (non-nullable
column)
> > of image data type is empty.
> >
> >
> >
Author
14 May 2005 7:31 AM
CBretana
Yes, you're right,  DataLength() is the only other way...

Show quote
"krygim" wrote:

> I got the error message: "The text, ntext, and image data types cannot be
> compared or sorted."
>
>
>
> "CBretana" <cbretana@areteIndNOSPAM.com> wrote in message
> news:3ADDA38D-0AC0-4377-9933-182222F35875@microsoft.com...
> > Or, actually, just check if the column's value itself = '' (empty
> string)...
> > That should work.  you don't need to attempt to extract the first
> character
> > and test that...
> >
> >
> >
> > "krygim" wrote:
> >
> > > Currently I use the follow Select statement to test if a non-nullable
> image
> > > column is empty and not null:
> > > Select Case When Substring(ImageColumn,1,1)='' Then 1 Else 0 End As
> IsEmpty
> > >
> > > Can any body show me a better way to check if a column (non-nullable
> column)
> > > of image data type is empty.
> > >
> > >
> > >
>
>
>

AddThis Social Bookmark Button