Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 T-SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-10-21 : 08:31:30
Aditya writes "Hello,

How I can define an 2d array using T-SQL?

Aditya"

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-10-21 : 08:36:42
You can't

But, if you go and buy The Guru's Guide to Transact SQL by Ken Henderson you will find some cool ways to emulate it (sort of).

Damian
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-21 : 08:38:40
We have a number of articles on passing arrays/parameters as comma-separated values (CSVs):

http://www.sqlteam.com/SearchResults.asp?SearchTerms=csv

For a 2D array, you can use a CSV with 2 delimiters, one for columns and another for rows. Some more detail is here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=19846

I suggest you read all of the related documents linked in that thread, they describe each part of the process in more detail.

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-10-21 : 23:46:12
A 2d array could be emulated with a table and three columns x,y and value or two tables linked in a relationship, there's lots of possiblities.
What data are you storing in your 2d array and how would you like to manipulate it??



Edited by - ValterBorges on 10/21/2002 23:51:56
Go to Top of Page

sanjnep
Posting Yak Master

191 Posts

Posted - 2002-10-22 : 01:04:49
Friend thank you for your question.
Pls use the table to store the 2d array in two different columns.
Thank you
..............................
"Heaven's light is our guide"
.....................

Sanjeevshrestha
Go to Top of Page
   

- Advertisement -