Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Display part of content field

Author  Topic 

eugz
Posting Yak Master

210 Posts

Posted - 2011-03-04 : 15:00:06
Hi All.

I would like to display just 20 characters of Comments field and rest substitute by [...]. How it to do?

Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-04 : 15:02:35
You can use the LEFT or SUBSTRING functions in T-SQL, but unless the Comments field is enormous, this formatting should likely be done in the application layer via the application code and not in T-SQL.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -