Hello

I want to store a dataset as XML to a single database value. As SQL Server
3.5 only allows a max length of 4000, I need to compress it before saving
it.
How can I do it?

Thanks

Re: .NET CF 3.5 & Compressing... by Christopher

Christopher
Thu Mar 13 06:27:06 CDT 2008

Hi,

James Cohn wrote:
> I want to store a dataset as XML to a single database value. As SQL
> Server 3.5 only allows a max length of 4000, I need to compress it
> before saving it.

I assume you are using a nvarchar(4000) field at present. If that is the
case have you considered converting the field to be a ntext or image field?

The following paragraph is lifted directly from the SQL Server Compact
Edition books online reference material:

ntext -
Variable-length Unicode data with a maximum length of (2^30?2)/2
(536,870,911) characters. Storage size, in bytes, is two times the
number of characters entered.

When using ntext fields you might like to check the tip about always
specifing the datatype of query parameters in the following MSDN Forums
posting -
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2738989&SiteID=1

Hope this helps,
Christopher Fairbairn

Re: .NET CF 3.5 & Compressing... by James

James
Thu Mar 13 08:11:53 CDT 2008

Oh thanks, I will use ntext... I was a bit confused when I tried to create
the ntext, it says length of 16...



"Christopher Fairbairn" <christopher@christec.co.nz> schrieb im Newsbeitrag
news:OvfPwtPhIHA.6084@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> James Cohn wrote:
>> I want to store a dataset as XML to a single database value. As SQL
>> Server 3.5 only allows a max length of 4000, I need to compress it before
>> saving it.
>
> I assume you are using a nvarchar(4000) field at present. If that is the
> case have you considered converting the field to be a ntext or image
> field?
>
> The following paragraph is lifted directly from the SQL Server Compact
> Edition books online reference material:
>
> ntext -
> Variable-length Unicode data with a maximum length of (2^30?2)/2
> (536,870,911) characters. Storage size, in bytes, is two times the number
> of characters entered.
>
> When using ntext fields you might like to check the tip about always
> specifing the datatype of query parameters in the following MSDN Forums
> posting -
> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2738989&SiteID=1
>
> Hope this helps,
> Christopher Fairbairn