|
Forums » .NET » SQL Server »
Posted Date: 27 Nov 2009 Posted By:: Ravi Member Level: Silver Member Rank: 1683 Points: 1
Responses:
3
|
I have table contain
c-01-06 c-01-08 c-01-10 c-01-12
How to write sql query to update
c-eco-01-06 c-eco-01-08 c-eco-01-10 c-eco-01-12
|
Responses
|
#448037 Author: Williams Member Level: Gold Member Rank: 255 Date: 27/Nov/2009 Rating:   Points: 3 | Hi,
update tableName set col=substring(col,0,2)+'eco'+right(col,6)
DARE TO BE DIFFERENT
| #448044 Author: Alwyn Duraisingh Member Level: Gold Member Rank: 11 Date: 28/Nov/2009 Rating:  Points: 2 |
update set col = Replace(col,'c-','c-eco-') from table
Regards, Alwyn Duraisingh.M << Database Administrator >> Jesus saves! The rest of us better make backups...
| #448211 Author: PUF Member Level: Gold Member Rank: 600 Date: 29/Nov/2009 Rating:  Points: 2 | update tableName set col = 'c-eco'+right(col,6)
or
update tableName set col = 'c-eco' + substring(col,2,Len(col))
|
|
| Post Reply |
|
|
|
 | | This thread is locked for new responses. Please post your comments and questions as a separate thread. If required, refer to the URL of this page in your new post. |
|
|
|
|
 Follow us on Twitter: https://twitter.com/dotnetspider
|
|