July 5, 2005 at 4:03 am
Hi,
I want to know how to get image data type value. I crated a table with One Image data type column
create
table Test(MetaInfo image)
Next i inserted One value
insert
into Test values('True')
How to read the value in the Test table of MetaInfo Column.
Note:- Don't ask me why you need to store this short information in Image data type. I'm in need of this situation.
Otherwise tell me is it possible to store information like Result='True' in the image data type and using query can we retrieve the Result Corresponding Result
Regards,
Vinoth
July 5, 2005 at 6:29 am
I'm not gonna ask why... but this will be a performance killer :
create table Test(MetaInfo image)
insert into dbo.Test (MetaInfo) values('True')
Select cast(cast(MetaInfo as varbinary(50)) as varchar(50)) as MetaInfo from dbo.Test
--True
DROP Table Test
July 5, 2005 at 9:00 am
usually Substring is the recommended function for this
select Substring(MetaInfo, 1, 8) as FileType from dbo.Test
hth
* Noel
July 5, 2005 at 9:02 am
You know better... I never use that datatype.
July 5, 2005 at 9:10 am
I have used it only on very limited occations that I have come across a design which is ussually not mine
* Noel
July 5, 2005 at 9:12 am
That's more like it .
Shall we dare to ask him why he's doing that?
July 5, 2005 at 9:18 am
I hope this is a backfill of some column, because the right thing will be to populate the type at insert time and not to query the image column
* Noel
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply