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)
 Array in Stored Procedure

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2003-04-01 : 17:22:00
Can Array variables be declared in Stored procedure?.
For example,
Var(1)
Var(2)
var(3)
.
.
.
var(10)
AS
DECLARE var(10)

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-04-01 : 17:24:27
This is part of the FAQ for SQLTEAM.com:

[url]http://www.sqlteam.com/FAQ.asp[/url]

Also, always do a search in the forums to see if your question has already been answered.

Tara
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-04-01 : 18:44:48
Not sure if the FAQ mentions this, but look into using a variable declared as a "table" datatype.

declare @T table(Val)

insert into @t
select 1
union
select 2
union
select 3
union
select 4

select * from @t

select sum(val) from @t

select count(*) from @t

much cooler and more versatile than a plan old array!


- Jeff
Go to Top of Page
   

- Advertisement -