Solved

SQL 2000 or 2005 and array...

Posted on 2008-06-11
8
308 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
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 150 total points
ID: 21766524
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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 150 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 200 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

789 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