[posted and mailed, please reply in public]
mingzhen (mi*********@yahoo.com) writes:
I have a problem here when I code stored procedure to manipulate data
in database. My idea is that if I can save all data I get in some
arrays I should be able to manipulate the arrays directly. But I do
not know how to declare arrays in SQL server stored procedure and do
not know other ways to do the same thing. Please help me out. Thanks
in advance.
It sounds like you are used to programming in 3GL, and want to apply
the same methods there. Actually, there are arrays in SQL, just
there right before your eyes. But they are not called arrays, but
tables, and are in many extents much more powerful than arrays. Arrays
you typically handle sequentially. While you can do this with a table,
you can also apply operations on many rows at the same time, which is
usually several magnitudes faster than sequential processeing.
--
Erland Sommarskog, SQL Server MVP,
so****@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp