Imagine a table in Microsoft Sql Server 2000 named Pictures with three
fields. A primary key ID(int), a Name(nvarchar) and a Picture(image)
field.
Lets put some records into the table. The first two fields as expected
would take an int and a string. The third field is of type image.
Instead of putting a bitmap in this field lets place an xml document
that has been streamed into a byte array. The xml document would
describe the Picture using say lines. If the picture was that of a
square we would have four lines in the xml document. You could think of
the xml document as something similar to vector graphics but the
details are not relevant. The important fact is that the contents of
the image field is NOT a bitmap but a binary stream of an xml document.
Now imagine we have a reporting tool like Crystal Reports that can be
used to report on this database table. Imagine we create a report by
using the three fields mentioned above. As far as Crystal is concerned
the first field is an int, the second a string and the third an image.
If our table had ten records and we preview the report we like to see
10 entries each consisting of an ID, Name and a Picture.
This can only happen if the image field contains a Bitmap, but as
mentioned above the field contains an xml document.
Now my question...
Can we write something in SQL Server 2000 (not 2005) to sit between the
table and Crystal Reports so to convert the XML document to a bitmap.
The restriction is that we cannot use anything but sql server itself.
The client in the above case has been Crystal Reports but it could be
anything.
I know SQL Server 2005 supports C# with access to the .NET framework
within the database. Unfortunately, I am not using SQL server 2005.
Some people have suggested the use of User Defined Functions and TSQL.
I like to know from the more experienced SQL Server people if what I am
trying to achieve is possible. Maybe it has not been done but is it
possible?
Any suggestions would be greatly appreciated...
Many Regards