SQL Server/T-SQL Tutorial/Data Types/WRITETEXT

Материал из SQL эксперт
Перейти к: навигация, поиск

WRITETEXT with a properly protected text pointer

   <source lang="sql">

4> CREATE TABLE pub_info 5> ( 6> pub_id char(4) NOT NULL, 7> logo image NULL, 8> pr_info text NULL 9> ) 10> GO 1> 2> BEGIN TRAN 3> DECLARE @mytextptr varbinary(16) 4> SELECT @mytextptr=TEXTPTR(pr_info) 5> FROM pub_info (UPDLOCK) WHERE pub_id="9999" 6> IF @mytextptr IS NOT NULL 7> WRITETEXT pub_info.pr_info @mytextptr "Hello Again" 8> COMMIT TRAN 9> 10> GO 1> 2> drop table pub_info; 3> GO 1> 2></source>