C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Update Query


Posted Date: 07 Nov 2009      Posted By: Sameer Sayani      Member Level: Gold     Points: 1   Responses: 5



I have a table tbl_price and a filed inside it which save data like 'Rs 20,000 extra over model M3.5 V2'. The data is already saved with different amount of Rs, but the remaining text is same.

Now i need to update only the text in this column, not the amount, ie lets say 'Rs 21,000 extra over model MV2 3.5'. I just need to shuffle the last portion of the text & update it only. Can partial update be possible?





Responses

Author: vipul    07 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

hi,
i think partial update is not possible for that you have to do hole update.

Please Rate This Answer If They Helpful

Thanks & Regards
Patel Vipul



Author: ABitSmart    07 Nov 2009Member Level: DiamondRating: 3 out of 53 out of 53 out of 5     Points: 3

You can use REPLACE function.

e.g.,

Update table tbl_price
Set columnName = Replace(columnName, 'TextToFind', 'TextToReplace')
where columnName like 'TextToFind'


Perhaps you can skip the where clause

Kind regards,
ABitSmart
DNS Web-master, DNS MVM
My blog
Thoughts.exe



Author: Shameer    08 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

UPDATE table tbl_price
SET
column_model = 'MV2 3.5',
column_amount = 'Rs 21,000'
WHERE
column_model = 'M3.5 V2'



Author: Shameer    08 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

UPDATE table tbl_price
SET
column_model = 'MV2 3.5',
column_amount = 'Rs 21,000'
WHERE
column_model = 'M3.5 V2'

Please rate if this useful..



Author: mithun    16 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

u can use UPDATE query for dis....


Post Reply
You must Sign In to post a response.
Next : Merging tables
Previous : Disadvantages of Cursor?
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use