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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 shortened string values from a db

Author  Topic 

settinUpShop
Starting Member

28 Posts

Posted - 2003-09-29 : 14:16:46
What is the best way to do this, using SQL Server, T-SQL, and ASP(VBScript)? If i have a column which contains long strings of text, and i only want to display the first 100 characters to the user, is there a way to select only the first 100 characters from each row in that column? Or would I need to shorten the string on the application level before displaying the values in a HTML table?

Thanks!

MichaelP
Jedi Yak

2489 Posts

Posted - 2003-09-29 : 14:51:04
If you shorten them in your Stored Proc (T-SQL) then you are moving less data across the pipe. I think some folks will tell you handle this in your preentation tier. Generally, that's best. If these strings are super long, it might be best to trim them in TSQL.


select LEFT('There''s no place like home, there''s no place like home', 10)


Michael



<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
   

- Advertisement -