Showing posts with label types. Show all posts
Showing posts with label types. Show all posts

Wednesday, March 21, 2012

passing array data types from/to a stored procedure?

Is there any way passing array data types from/to a stored procedure?
Please reply. Thanks in advance.
Regards,
Hyun-jik BaeBae
SQL Server does not supprt arrays but you can do something like that
CREATE PROCEDURE array_sp
@.array nvarchar(4000)
AS
BEGIN
SET NOCOUNT ON
DECLARE @.nsql nvarchar(4000)
SET @.nsql = '
SELECT *
FROM sysobjects
WHERE name IN ( ' + @.array + ')'
PRINT @.nsql
EXEC sp_executesql @.nsql
END
GO
EXEC array_sp
@.array = '''sysobjects'',''sysindexes'',''syscolu
mns'''
GO
"Bae,Hyun-jik" <imays@.NOSPAM.paran.com> wrote in message
news:%23pxpkj8TFHA.1796@.TK2MSFTNGP15.phx.gbl...
> Is there any way passing array data types from/to a stored procedure?
> Please reply. Thanks in advance.
> Regards,
> Hyun-jik Bae
>|||Passing Arrays:
http://vyaskn.tripod.com/passing_ar..._procedures.htm
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Uri Dimant" <urid@.iscar.co.il> schrieb im Newsbeitrag
news:uqnPwu8TFHA.2520@.TK2MSFTNGP09.phx.gbl...
> Bae
> SQL Server does not supprt arrays but you can do something like that
> CREATE PROCEDURE array_sp
> @.array nvarchar(4000)
> AS
> BEGIN
> SET NOCOUNT ON
> DECLARE @.nsql nvarchar(4000)
> SET @.nsql = '
> SELECT *
> FROM sysobjects
> WHERE name IN ( ' + @.array + ')'
> PRINT @.nsql
> EXEC sp_executesql @.nsql
> END
> GO
>
> EXEC array_sp
> @.array = '''sysobjects'',''sysindexes'',''syscolu
mns'''
> GO
> "Bae,Hyun-jik" <imays@.NOSPAM.paran.com> wrote in message
> news:%23pxpkj8TFHA.1796@.TK2MSFTNGP15.phx.gbl...
>|||http://www.sommarskog.se/arrays-in-sql.html
Jacco Schalkwijk
SQL Server MVP
"Bae,Hyun-jik" <imays@.NOSPAM.paran.com> wrote in message
news:%23pxpkj8TFHA.1796@.TK2MSFTNGP15.phx.gbl...
> Is there any way passing array data types from/to a stored procedure?
> Please reply. Thanks in advance.
> Regards,
> Hyun-jik Bae
>|||SQL has one data structure, the table. There are not arrays. You can
kludge it with strings that hold CSV. It is slow, procedural and
cannot guarantee data integrity. The right way is to load the data into
a table and start thinking in terms of SQL solutions instead of your
previous programming languages.

Monday, February 20, 2012

PARTITION'ing Types

Hello All,
I'm new to SQLServer 2005 though I have fairly good knowledge on SQLServer
2000.
I have to implement PARTITION feature that is in SQLServer 2005 and I was
going through BOL and I just wanted to clarify.
Are there Different Types of PARTITIONs. I'm asking since I would want to
chose the one that is optimal.
Thanks,
rgnHi rgn
It was originally planned that you could have either a RANGE partition or a
HASH partition, but HASH partitions did not make the cut. We only have RANGE
partitions.
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://sqlblog.com
"rgn" <rgn@.discussions.microsoft.com> wrote in message
news:618481E3-2D7F-481D-9012-7B311D80BB8A@.microsoft.com...
> Hello All,
> I'm new to SQLServer 2005 though I have fairly good knowledge on SQLServer
> 2000.
> I have to implement PARTITION feature that is in SQLServer 2005 and I was
> going through BOL and I just wanted to clarify.
> Are there Different Types of PARTITIONs. I'm asking since I would want to
> chose the one that is optimal.
> Thanks,
> rgn
>

PARTITION'ing Types

Hello All,
I'm new to SQLServer 2005 though I have fairly good knowledge on SQLServer
2000.
I have to implement PARTITION feature that is in SQLServer 2005 and I was
going through BOL and I just wanted to clarify.
Are there Different Types of PARTITIONs. I'm asking since I would want to
chose the one that is optimal.
Thanks,
rgn
Hi rgn
It was originally planned that you could have either a RANGE partition or a
HASH partition, but HASH partitions did not make the cut. We only have RANGE
partitions.
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://sqlblog.com
"rgn" <rgn@.discussions.microsoft.com> wrote in message
news:618481E3-2D7F-481D-9012-7B311D80BB8A@.microsoft.com...
> Hello All,
> I'm new to SQLServer 2005 though I have fairly good knowledge on SQLServer
> 2000.
> I have to implement PARTITION feature that is in SQLServer 2005 and I was
> going through BOL and I just wanted to clarify.
> Are there Different Types of PARTITIONs. I'm asking since I would want to
> chose the one that is optimal.
> Thanks,
> rgn
>

PARTITION'ing Types

Hello All,
I'm new to SQLServer 2005 though I have fairly good knowledge on SQLServer
2000.
I have to implement PARTITION feature that is in SQLServer 2005 and I was
going through BOL and I just wanted to clarify.
Are there Different Types of PARTITIONs. I'm asking since I would want to
chose the one that is optimal.
Thanks,
rgnHi rgn
It was originally planned that you could have either a RANGE partition or a
HASH partition, but HASH partitions did not make the cut. We only have RANGE
partitions.
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://sqlblog.com
"rgn" <rgn@.discussions.microsoft.com> wrote in message
news:618481E3-2D7F-481D-9012-7B311D80BB8A@.microsoft.com...
> Hello All,
> I'm new to SQLServer 2005 though I have fairly good knowledge on SQLServer
> 2000.
> I have to implement PARTITION feature that is in SQLServer 2005 and I was
> going through BOL and I just wanted to clarify.
> Are there Different Types of PARTITIONs. I'm asking since I would want to
> chose the one that is optimal.
> Thanks,
> rgn
>