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)
 array in sqlserver2000

Author  Topic 

smhjm
Starting Member

3 Posts

Posted - 2005-12-18 : 08:20:27
Hello MyFriends
I want insert too many data to a table and doing this with StoredProcedures but i want now an array in sqlserver that get my data and insert those data in my table
how i define an array in sql server or T_SQl has an array or you have any solution for this?

Plaese help to me
thanks
smhjm

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-18 : 10:10:38
Welcome to SQLTeam.

There is no array in T-SQL. You don't need array anyway. What are you trying to achieve ? Post your table structure, sample data & required result. We will be able to advice you accordingly

-----------------
[KH]

Learn something new everyday
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-18 : 10:29:51
Yes,
no arrays
see this
http://sqlteam.com/item.asp?ItemID=637
http://www.databasejournal.com/features/mssql/article.php/1552701
http://www.elists.org/pipermail/delphi-db/2004-September/007723.html


but what are you trying to achieve ?

We have a similar problem, that receives dynamic and another with static parameters, which our sp iterates thru them and does some work in the SP

Afrika
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-19 : 00:57:06
Do you want to pass csv values and do search based on that?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

smhjm
Starting Member

3 Posts

Posted - 2005-12-19 : 07:02:41
Hi
I have a checkBoxList that get its data from a table.
User checked any item that want and i should insert this data in another table with an id that define the user.
For example user checked 20 books and i should insert 20 row in my table that any row has an id of book and an id of that user.
I should do this with storedProcedure but i can't use of variable because i don't know how many item was checked with user.
Know i want with just one connection to database do this inserting.
I use of c#.
what your idea about doing this just with storedProcedures.
thanks advanced.
smhjm
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-19 : 07:39:05
Actually quite simple.

I would advice you
1. Pass a csv string to calling SP
2. Create a while loop in your sp to accept the csv string
3. do an insert based on each "DYNAMIC" csv string

It really dont matter what front end you are using as long as you pass your csv and get your sp right, i woudl advice you paste your sp code here


do u understand ?

afrika
Go to Top of Page
   

- Advertisement -