|
Posted by Dan on 01/03/07 21:33
Thanks Erland, you hit the nail on the head, i misunderstood what the
textptr did and thought both could be set at the same point. Hopefully
this will be the one and only time i have to use either text
concatenation or cursors. Is is the varchar(max) that replaces text in
SQL Server 2005?
Thanks again
Dan
Erland Sommarskog wrote:
> Dan (dan_barber2003@hotmail.com) writes:
> > select
> > @profileid = min([id]),
> > @ptr1 = MIN(textptr(text1))
> > from #holding
> > where [id] > @profileid
>
> This does not look good. Is there are any reason to assume that text
> pointers are aligned with id?
>
> Either do
>
> SELECT @profileid = MIN(id)
> FROM #holding
> WHERE id > @profileid
>
> SELECT @ptr1 = textptr(text1) FROM #holding WHERE id = @profileid
>
> Or run a second cursor over #holding.
>
> And, yeah, this is ugly, painful and no fun at all. But it's the only
> alternative.
>
> In SQL 2005 there are new data types that replaces text & co, and
> which does not have all the restrictions of text. Or the need to
> use UPDATETEXT...
>
>
> --
> 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]
|