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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Can SQL data type be arrayed similarly to VB

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-09-07 : 08:46:06
Andy writes "In vb I can write a variable declaration like below.

dim lngVariable(255) as long

This gives me a long type variable array where I can easily access any of the (256) values.

I'm running SQL 2000 and it would be handy in a couple of stored procedures to be able to use a similar method, but I can't find anything out about this in the help. I could probably use a table type, but this would require a larger overhead than just getting the value directly.

Any ideas greatly appreciated.

TIA
Andy"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-09-07 : 08:49:24
In SQL (not just SQL Server) tables are analagous to array structures. They are actually more powerful than normal arrays. It would not be extra overhead to retrieve values if you create the table properly. A little more detail about what you're trying to do would help (sorry this took so long to get posted)
Go to Top of Page
   

- Advertisement -