Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fulltext as a column name

Status
Not open for further replies.

cfaulkner

Programmer
Oct 13, 1998
33
US

We have a vendor that decided using SQL keywords was ok for column names. I have a column named "fulltext" that I must manipulate. BOL states that you can do this but that you then must address them as quoted identifiers. I can't get anything to read this column when used in a function like LEN().

These all fail:

select top 10 len(fulltext)
from dbo.localevent (nolock)

select top 10 len([fulltext])
from dbo.localevent (nolock)

so does using set quoted identifier on and "'s

Any ideas on how to manipulate this column in a select statement?

Thanks!
 
If the column is a text datatype then you can't use LEN

try datalength instead

These functions and statements can be used with ntext, text, or image data.

Functions Statements
DATALENGTH
READTEXT
PATINDEX
SET TEXTSIZE
SUBSTRING
UPDATETEXT
TEXTPTR
WRITETEXT
TEXTVALID


Denis The SQL Menace
SQL blog:
Personal Blog:
 
Thank you, this worked:

select substring([fulltext],84,datalength([fulltext]))

I need to strip the first part of this off.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top