Solved

SQL 2000 or 2005 and array...

Posted on 2008-06-11
8
306 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
 
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

863 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

20 Experts available now in Live!

Get 1:1 Help Now