|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Check if image column is emptyCurrently 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. 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. > > > 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. > > > > > > 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. > > > 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. > > > > > > 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. > > > > > > > > > > > > |
|||||||||||||||||||||||