Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL 2000 or 2005 and array...

Posted on 2008-06-11
8
Medium Priority
?
315 Views
Last Modified: 2010-04-21
I am wondering if it is possible to run a selct query in a sp, and have the output variable return an array of the rows?
0
Comment
Question by:kevp75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 8

Expert Comment

by:Thejaka
ID: 21766103
A table variable can be returned from a UDF, but not an SP.

How do you intend to use the returned values?
0
 
LVL 2

Expert Comment

by:howyue
ID: 21766152
as far as i know there are no array in sql server, for 1 dimension array u can convert it as string for m-dimension. can u explain how to uexpect ur output to be ?
0
 
LVL 22

Assisted Solution

by:dportas
dportas earned 600 total points
ID: 21766524
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 25

Author Comment

by:kevp75
ID: 21768412
I guess, I am wondering if I can return a recordset from a sp... in code...

(please bear with me, I usually only use sql to store data... not do the work...)
0
 
LVL 25

Author Comment

by:kevp75
ID: 21768429
sorry.  in code as in, I'll be calling this from a classic asp page ...
0
 
LVL 2

Assisted Solution

by:howyue
howyue earned 600 total points
ID: 21769044
u can write a sp that contains ur query and return the resultset in XML. and with XML i'm sure XML is more convenient for asp than array
0
 
LVL 8

Accepted Solution

by:
Thejaka earned 800 total points
ID: 21778967
You CAN indeed do as you intend...

http://support.microsoft.com/kb/306574


Alternately, you could use a table-valued UDF.
0
 
LVL 25

Author Closing Comment

by:kevp75
ID: 31466440
thanks folks
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question