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.
| Author |
Topic |
|
Dejan
Starting Member
14 Posts |
Posted - 2008-10-26 : 08:13:25
|
| Hello,I have Stored procedure to call last 3 news in my table:ALTER PROCEDURE dbo.top3News@id_lang intASSELECT TOP 3 id_news, id_lang, subject, newstext, dateFROM newsWHERE (id_lang = @id_lang)ORDER BY id_news DESC RETURNnewstext field is ntext. I'd like to show only first 500 charachters of the value and add '...' at the end of the text.Thanks for the help |
|
|
Dejan
Starting Member
14 Posts |
Posted - 2008-10-26 : 13:52:21
|
| ALTER PROCEDURE dbo.top3News@id_lang intASSELECT TOP 3 id_news, id_lang, subject, date substring (newstext,1,450) as text, FROM newsWHERE (id_lang = @id_lang)ORDER BY id_news DESCRETURNThis is the solution |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-26 : 13:52:39
|
quote: Originally posted by Dejan Hello,I have Stored procedure to call last 3 news in my table:ALTER PROCEDURE dbo.top3News@id_lang intASSELECT TOP 3 id_news, id_lang, subject, SUBSTRING(newstext,1,500) + '...' AS newstext, dateFROM newsWHERE (id_lang = @id_lang)ORDER BY id_news DESC RETURN newstext field is ntext. I'd like to show only first 500 charachters of the value and add '...' at the end of the text.Thanks for the help
modify as above. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-26 : 13:59:18
|
|
 |
|
|
|
|
|
|
|