-2

i have table,

   id        Name   

   1      aaaaAAbbbb 
   2      bbbbAAaaaa 
   3      aabbAAbbaa 

This is my table,i want to update 'AA' with 'BB' using sql server 2008

1
  • 1
    Did you try something ? What is problem ? Commented Jan 9, 2015 at 11:37

2 Answers 2

2
update myTable set [Name] = REPLACE([Name], 'AA', 'BB')

REPLACE applies to SQL Server 2008 upwards.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks...but this will update all 'a' with 'B'..i want Only AA with BB
This probably means that your collation is set to case-insensitive. You can get around this by specifiying the collation that REPLACE should apply (see the link I referenced).
0

You can use

 REPLACE(Name,'AA','BB');

and update you column.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.