Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using Array in T-SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-02-16 : 07:28:59
Wafi writes "Hi There,,

I am currently using MS SQL Server 2000 as a Database Server

iam wondaring if i can pass an Array as a parameter to Stored procedure and handle it in T-SQL

if so please tell how and if not tell what is the best to do this thing

Wating for ur replay as soon as possible

Best regards
Wafi Mohtaseb"

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2004-02-16 : 07:36:30
quote:
Originally posted by AskSQLTeam

Wafi writes "Hi There,,

I am currently using MS SQL Server 2000 as a Database Server

iam wondaring if i can pass an Array as a parameter to Stored procedure and handle it in T-SQL

if so please tell how and if not tell what is the best to do this thing

Wating for ur replay as soon as possible

Best regards
Wafi Mohtaseb"



you can pass an array the stored proc as a parameter.
there are many threads on this forum regarding to passing arrays as parameters to sp's
check:
http://www.sqlteam.com/item.asp?ItemID=637

He is a fool for five minutes who asks , but who does not ask remains a fool for life!
Go to Top of Page

stephe40
Posting Yak Master

218 Posts

Posted - 2004-02-16 : 11:35:19
Convert the array to xml. Pass that into the sp. Use the openxml function to open the xml.

insert into table
select * from openxml(...)

- Eric
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-02-17 : 08:14:52
No need for XML at all, CSVs are fine. If you have a lot of data you can put it into a temp table before you call the procedure, and write the procedure to pull the data from the temp table.
Go to Top of Page
   

- Advertisement -