Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Friday, March 9, 2012

Dose sqlserver 2000 support Array type?

Any one know about it?NO|||No, there is none (builtin) Sure you can define your own type with the new SQL Server 2005 but there is array type.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de
|||Can't you just use a table with one column as an array? You could create a table variable in this way that would act like an array, maybe add an identity column which would be your index, and the second column would be your data column. This is not an array, but can be used like one, for example you could iterate through it with a cursor or a while loop.|||Alternatively, use a large varchar, and biuld a string of your array elements, delimitering them with a set char, then use a while loop and CHARINDEX() to iterate through the elements.|||

There is no array type. Some of the other posters mentioned the work-arounds.

We'd be grateful if you could take a few moments and tell us what you're trying to do.

Thanks

|||You can use this function I posted some time ago:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=320221&SiteID=1

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

dose not SQL-Server has Array data-type?

hi,
in SQL Server Books Online in sp_executesql page thay have this example:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level',
N'@.level tinyint',
@.level = 35
i need to accomplish a similar task, but with un-predictable (may be dozens
of) numbers of parameters.
so, instead of doing something like this (with much more than two
parameters):
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level or
job_lvl = @.level2',
N'@.level tinyint , @.level2 tinyint',
@.level = 35
,@.level2 = 32
i want to do something like this:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl in ( @.level ) ',
N'@.level ?? ',
@.level = 35,32
which does not work ,of course......
any ideas?
thanks,
edo
See if this helps:
http://vyaskn.tripod.com/passing_arr...procedures.htm
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"edo" <ewilde@.nana.co.il> wrote in message
news:efwHDCdhEHA.556@.tk2msftngp13.phx.gbl...
hi,
in SQL Server Books Online in sp_executesql page thay have this example:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level',
N'@.level tinyint',
@.level = 35
i need to accomplish a similar task, but with un-predictable (may be dozens
of) numbers of parameters.
so, instead of doing something like this (with much more than two
parameters):
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level or
job_lvl = @.level2',
N'@.level tinyint , @.level2 tinyint',
@.level = 35
,@.level2 = 32
i want to do something like this:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl in ( @.level ) ',
N'@.level ?? ',
@.level = 35,32
which does not work ,of course......
any ideas?
thanks,
edo

dose not SQL-Server has Array data-type?

hi,
in SQL Server Books Online in sp_executesql page thay have this example:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level',
N'@.level tinyint',
@.level = 35
i need to accomplish a similar task, but with un-predictable (may be dozens
of) numbers of parameters.
so, instead of doing something like this (with much more than two
parameters):
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level or
job_lvl = @.level2',
N'@.level tinyint , @.level2 tinyint',
@.level = 35
,@.level2 = 32
i want to do something like this:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl in ( @.level ) ',
N'@.level '? ',
@.level = 35,32
which does not work ,of course......
any ideas?
thanks,
edoSee if this helps:
http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"edo" <ewilde@.nana.co.il> wrote in message
news:efwHDCdhEHA.556@.tk2msftngp13.phx.gbl...
hi,
in SQL Server Books Online in sp_executesql page thay have this example:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level',
N'@.level tinyint',
@.level = 35
i need to accomplish a similar task, but with un-predictable (may be dozens
of) numbers of parameters.
so, instead of doing something like this (with much more than two
parameters):
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl = @.level or
job_lvl = @.level2',
N'@.level tinyint , @.level2 tinyint',
@.level = 35
,@.level2 = 32
i want to do something like this:
execute sp_executesql
N'select * from pubs.dbo.employee where job_lvl in ( @.level ) ',
N'@.level '? ',
@.level = 35,32
which does not work ,of course......
any ideas?
thanks,
edo