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
 SQL Server Development (2000)
 chop off characters after certain limit

Author  Topic 

hueby
Posting Yak Master

127 Posts

Posted - 2005-11-29 : 18:05:36
Hi all, I am wanting to go through a column of data (varchar) that is 20 characters long and chop off all characters after 10, but keep the column at 20 characters long. What kind of commands can I use to accomplish this?

SamC
White Water Yakist

3467 Posts

Posted - 2005-11-29 : 18:36:20
[code]
UPDATE MyTable
SET MyColumn = LEFT(MyColumn, 10)[/code]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-30 : 03:00:53
If it is for display purpose, then

Select left(yourCol,10) from yourTable

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -