How can I initialize arrays in stored procedures?
0
Q:
How can I initialize arrays in stored procedures?
How can I initialize arrays in stored procedures?
ASKED: Mar 16 2008  10:20 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
46810 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
SQL Server doesn't support array's within or outside of stored procedures.

The closest thing that SQL Server has would be a table variable. It's accessed just like a regular or temp table, but it's done mostly in memory.

DECLARE @TableVar TABLE
(Col1 INT,
Col2 INT,
Col3 VARCHAR(10))

INSERT INTO @TableVar
SELECT 1, 2, 'test'

SELECT *
FROM @TableVar
Last Answered: Mar 16 2008  11:46 PM GMT by Mrdenny   46810 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Mrdenny   46810 pts.  |   Mar 16 2008  11:46PM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 
0