How can I initialize arrays in stored procedures?
How can I initialize arrays in stored procedures?

Software/Hardware used:
ASKED: March 16, 2008  10:20 PM
UPDATED: March 16, 2008  11:46 PM

Answer Wiki:
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. <pre>DECLARE @TableVar TABLE (Col1 INT, Col2 INT, Col3 VARCHAR(10)) INSERT INTO @TableVar SELECT 1, 2, 'test' SELECT * FROM @TableVar</pre>
Last Wiki Answer Submitted:  March 16, 2008  11:46 pm  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 64,520 pts.