|
Posted by Erland Sommarskog on 09/15/07 07:35
James Fraser (jbf1@concentric.net) writes:
> But maybe I didn't think ahead far enough:
> How can I run this SP or UDF on all of the rows in my original table.
>
> I want the functionality of something like this:
> SELECT * FROM my_fn ( inputtable.row1binaryfield)
> UNION
> SELECT * FROM my_fn (inputtable.row2binaryfield)
> .
> .
> UNION
> SELECT * FROM my_fn( inputtable.rowlastbinaryfield)
>
> where the binary inputs are coming from the original table in the db.
> I'm on SQL 2000, BTW. Right now, I have the feeling that a cursor is
> the way out of this.
Yes, on SQL 2000 you are stuck with a cursor. SQL 2005 offers the APPLY
operator to address this.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|