Export (0) Print
Expand All
Expand Minimize
0 out of 2 rated this helpful - Rate this topic

TEXTVALID (Transact-SQL)

A text, ntext, or image function that checks whether a specific text pointer is valid.

ms187362.note(en-US,SQL.90).gifImportant:
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Alternative functionality is not available.

Topic link icon Transact-SQL Syntax Conventions


TEXTVALID ( 'table.column' ,text_ ptr )
table

Is the name of the table that will be used.

column

Is the name of the column that will be used.

text_ptr

Is the text pointer to be checked.

Returns 1 if the pointer is valid and 0 if the pointer is not valid. Note that the identifier for the text column must include the table name. You cannot use UPDATETEXT, WRITETEXT, or READTEXT without a valid text pointer.

The following functions and statements are also useful when you work with text, ntext, and image data.

Function or statement Description

PATINDEX('%pattern%' , expression)

Returns the character position of a specified character string in text and ntext columns.

DATALENGTH(expression)

Returns the length of data in text, ntext, and image columns.

SET TEXTSIZE

Returns the limit, in bytes, of the text, ntext, or image data to be returned with a SELECT statement.

The following example reports whether a valid text pointer exists for each value in the logo column of the pub_info table.

ms187362.note(en-US,SQL.90).gifNote:
To run this example, you must install the pubs database. For information about how to install the pubs database, see Downloading Northwind and pubs Sample Databases.

USE pubs;
GO
SELECT pub_id, 'Valid (if 1) Text data' 
   = TEXTVALID ('pub_info.logo', TEXTPTR(logo)) 
FROM pub_info
ORDER BY pub_id;
GO

Here is the result set.

pub_id Valid (if 1) Text data 
------ ---------------------- 
0736   1                      
0877   1                      
1389   1                      
1622   1                      
1756   1                      
9901   1                      
9952   1                      
9999   1                      

(8 row(s) affected)
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.