cancel
Showing results for 
Search instead for 
Did you mean: 

XML Datatype

Former Member
0 Kudos

I need to save a xml file into a SQL database, but I can't create a field of XML datatype by B1. Do you have any suggestion on how can I save this file. I don't want to use ntext because it will be obsolete in the future. Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Danilo

It depends what you need it for. If you just want to be able to find your xml based on a value in an UDF you can try to store XML in file system and put just a path in your field. Or you can set a field to type 'link' and link your XML as an attachment to your object. Or you can create your own table in database with let's say two fields (one id identity(1,1), second xml XML) and put only value of id in SAP's UDF.

Kind regards,

Radek

Former Member
0 Kudos

Thanks Radoslaw,

For this situation I really need to save the whole file in database, not the path, I'm not sure if I can create a table without using UTB and UDF

Answers (2)

Answers (2)

edy_simon
Active Contributor
0 Kudos

Hi Danilo,

It depends on whether you are storing the content of the file or the file it self.

If you are storing the xml content only, i would go with what   has suggested.

But if you need to store the file it self, I would recommend you to keep your own table so you can set your own data type either varbinary or image or xml with a RecordID for each file.

You will then store this RecordID in  related SBO table UDF.


Regards

Edy

maik_delly
Active Contributor
0 Kudos

Hi Danilo,

imho you should use a ntext field. The only argument against is that in future versions of MSSQL this type is not supported anymore. But right now it is and SBO is using ntext for its memo fields.

So basically it is a problem of SAP to make sure, future versions of MSSQL can be used ( planned ?? )  and when upgrading ntext fields that they are converted to nvarchar.

I really can't imagine SAP saying : so far you were able to save big texts in a field, now we will cut all the data.

regards,

Maik