Re: Save a structure's instance to a Database

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Peter (zlxmqyt_at_sina.com)
Date: 09/30/04


Date: Thu, 30 Sep 2004 22:49:25 +0800

Thank you, Tiber. I'm learning more and more from you.

"Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com>
wrote:u$$QqChpEHA.692@TK2MSFTNGP12.phx.gbl...
> > I can serialise the instance of a complex structure(about 32KB) to XML
and
> > save it to a field of varchar type.
>
> Nope. Max possible storage length for varchar is 8000 bytes. Perhaps you
were thinking of the text
> or ntext datatypes?
>
>
> >and then like you said I can also save
> > it as raw binary data. Use the "image" datatype for that. Which is a
better
> > choice between up two?
>
> Impossible to answer. There is seldom one way which is always "better", if
so, the other way
> wouldn't exists. Only you can determine this based on your requirements,
what you want to do with
> the data, what type of modifications you want to perform using SQL on this
data, or if you only want
> to get it in and out of the database. Etc. etc.
>
>
> > I had never designed a database before.
>
> Please don't take this the wrong way, but you might find saving yourself a
lot of future trouble by
> hiring someone with experience to help you out with this. Getting the
datamodel right is so very
> fundamental, and not getting it right is something you will regret deeply
until you realize that you
> finally get to the sage where you re-design it properly.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "Peter" <zlxmqyt@sina.com> wrote in message
news:%23dktCfcpEHA.3392@TK2MSFTNGP15.phx.gbl...
> > Tibor,
> >
> > I can serialise the instance of a complex structure(about 32KB) to XML
and
> > save it to a field of varchar type. and then like you said I can also
save
> > it as raw binary data. Use the "image" datatype for that. Which is a
better
> > choice between up two?
> >
> > I had never designed a database before.
> >
> > Peter
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com>
> > wrote:#jO12tGpEHA.868@TK2MSFTNGP10.phx.gbl...
> > > You can save it as raw binary data. Use the "image" datatype for that.
> > >
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > http://www.karaszi.com/sqlserver/default.asp
> > > http://www.solidqualitylearning.com/
> > >
> > >
> > > "Peter" <zlxmqyt@sina.com> wrote in message
> > news:u33s7SFpEHA.3464@tk2msftngp13.phx.gbl...
> > > > I have defined a complex structure with vb.net. One instance of it
will
> > be
> > > > about 32KB. Is it possible to save it to a SQL Server database and
how
> > to do
> > > > it?
> > > >
> > > > Thanks in advance.
> > > >
> > > > Peter
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Save a structures instance to a Database
    ... >> save it to a field of varchar type. ... >> I had never designed a database before. ... > Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Save a structures instance to a Database
    ... >> save it to a field of varchar type. ... >> I had never designed a database before. ... > Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Save a structures instance to a Database
    ... Thank you, Tibor, I'm learning more and more from you. ... >> save it to a field of varchar type. ... >> I had never designed a database before. ... > Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: STANDBY mode
    ... the restore commands for you and possibly copies the undo file to some ... Tibor Karaszi, SQL Server MVP ... RESTORE DATABASE cashx ...
    (microsoft.public.sqlserver.server)
  • Thank you!
    ... Just for the sake of completeness, as of 2005, we are recommended to ... use a modern way to move database files: ... Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.server)