Article ID: 170507
Article Last Modified on 2/20/2004
S E R V P A C K
use pubs
go
create table test (Tvalue text)
go
insert into test values('This is a test')
go
select textptr(Tvalue) from test
go
-- To demonstrate the problem, the following hard coded text pointer
-- value should be based on the result of the previous select:
readtext test.Tvalue 0x510100000000000001000000aa100000 0
0
go
--
-- The following error message is displayed:
-- Msg 7134, Level 16, State 2
--
-- The following code segment works fine:
declare @txtptr varbinary(16)
select @txtptr=textptr(Tvalue) from test
readtext test.Tvalue @txtptr 0 0
go
--
-- READTEXT only fails if it is the first statement of the batch.
-- The following code segment also works:
select * from titles where title_id = 'PS7777'
readtext test.Tvalue 0x510100000000000001000000aa100000 0
0
go
Additional query words: Transact-SQL T-SQL tsql transql transsql sp sp3
Keywords: kbbug kbfix kbusage KB170507