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
 Development Tools
 Reporting Services Development
 how to declare array in stored procedures

Author  Topic 

vaishanavi
Starting Member

9 Posts

Posted - 2009-03-20 : 07:46:20
how to declare array in stored procedures in sql server 2005

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-03-20 : 08:43:11
closest thing is a table variable

DECLARE @foo TABLE (
[Id] INT IDENTITY(1,1)
, [valA] NVARCHAR(255)
)

INSERT @foo SELECT 'a'
INSERT @foo SELECT 'b'

SELECT * FROM @foo



Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-20 : 09:01:46
http://sommarskog.se/arrays-in-sql.html

Madhivanan

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

- Advertisement -