tags:

views:

157

answers:

3

Hi all, I want to add the 2-dimentional array in the sql server 2000 using c#. But the problem is that there is not array data type in sql. Kindly help me that how can I add the 2-dimentional array in sql server. Thanx for viewing my question...

A: 

Database fields are used for storing single items of data. Any data structures must be mapped to columns and tables in the database - not added to individual database fields.

What sort of data are you storing? If you want to do any kind of indexing or searching of the individiual items of the array then you'd be far better coming up with a database design to reflect the data you're modelling (so an array of cartesian coordinates mgiht map to a table containing x,y and z columns).

If this is to simply store some data for later retrieval then you can add it as a BLOB field and just serialize and deserialize to and from it.

Mark Pim
+1  A: 

A 2-D array is, essentially, a table. So you need to add a table to your database to hold this array. If you need to hold multiple array instance than add an additional column to store a key that will be common to individual arrays.

Joel Coehoorn
A: 

Don't know what you are trying to accomplish since you are not giving any details but take a look at Arrays and Lists in SQL Server 2005 or Arrays and Lists in SQL Server (SQL 2000 and Earlier)

SQLMenace