dotnetspider.com
Login Login    Register      

TutorialsForumCareer DevelopmentResourcesReviewsJobsInterviewCommunitiesProjectsTraining

Subscribe to Subscribers
Talk to Webmaster
Tony John

Facebook
Google+
Twitter
LinkedIn
Online MembersPhagu Mahato
More...
Join our online Google+ community for Bloggers, Content Writers and Webmasters




Forums » .NET » SQL Server »

Update


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: 3 out of 53 out of 53 out of 5     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: 2 out of 52 out of 5     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: 2 out of 52 out of 5     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.



Next : Disable Stored Procedures
Previous : Error in sql sub query
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.