Re: Array in TSQL?
Kevin Spencer (kevin@DIESPAMM ERSDIEtakempis. com) writes:[color=blue]
> In fact, while arrays are not a native SQL data type, XML is in fact, a
> Transact-SQL data type. So, one could certainly use an XML array, or any
> other type of XML structure in a Stored Procedure.[/color]
Yes, XML is indeed a native data type, and there is a whole of things you
can use that data type for. Far more things that you can think of at
first hand. If all you want is a simple array, XML is an overkill in my
opinion. But if you have structured data that you want to pass to SQL
Server, putting it into an XMl document and shred it in SQL Server, can
reduced load time immensly by savin network roundtrips. In fact, this
you can do already in SQL 2000. But you can do a lot more with XML in
SQL 2005.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se
Books Online for SQL Server SP3 at
Kevin Spencer (kevin@DIESPAMM ERSDIEtakempis. com) writes:[color=blue]
> In fact, while arrays are not a native SQL data type, XML is in fact, a
> Transact-SQL data type. So, one could certainly use an XML array, or any
> other type of XML structure in a Stored Procedure.[/color]
Yes, XML is indeed a native data type, and there is a whole of things you
can use that data type for. Far more things that you can think of at
first hand. If all you want is a simple array, XML is an overkill in my
opinion. But if you have structured data that you want to pass to SQL
Server, putting it into an XMl document and shred it in SQL Server, can
reduced load time immensly by savin network roundtrips. In fact, this
you can do already in SQL 2000. But you can do a lot more with XML in
SQL 2005.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se
Books Online for SQL Server SP3 at
Comment