Solved

SQL 2000 or 2005 and array...

Posted on 2008-06-11
8
311 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 150 total points
ID: 21766524
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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.

688 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