Solved

SQL 2000 or 2005 and array...

Posted on 2008-06-11
8
305 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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 8

Expert Comment

by:Thejaka
Comment Utility
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
Comment Utility
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 150 total points
Comment Utility
0
 
LVL 25

Author Comment

by:kevp75
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 25

Author Comment

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

Assisted Solution

by:howyue
howyue earned 150 total points
Comment Utility
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 200 total points
Comment Utility
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
Comment Utility
thanks folks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now