| 
	
 | 
 Posted by Erland Sommarskog on 01/02/07 22:33 
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] 
 |