sql server programming:
[quoted text, click to view] "Nils Wolf" <nisse@gmx.at> wrote in message
news:e9bT6j4yFHA.1032@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I need to store a 2D Array in a Table.
> What is the easiest way to to this. the array would only contain integer
> values..
>
> anyone a better idea than "implode" the Array in a string and "explode" it
> again in the program code?
>
Well, storing it in a binary IMAGE column, or VARBINARY if it's small is a
whole lot better than using a string. Most programming environments know
how to convert integer arrays back and forth to byte arrays, and SQL Server
knows how to store and retrieve byte arrays.
But consider whether it's really best to hide the structure of your data
from SQL Server. Sometimes there's really no alternative, but if you can
find a way to model your data with tables and rows, it might be easier to
store, retrieve and manipulate, and if your arrays are sparse it may even be
more efficient.
David