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.
| Author |
Topic |
|
tchelcho
Starting Member
4 Posts |
Posted - 2008-06-18 : 12:27:10
|
| I have two questions. I am somewhat of a novice at this but would really appreciate some help.Table = svcThere are multiple columns but I just need adjustments in the first 2.Current Table:code name svctypeCTS0003 CT Abd Ltd 51608CTS0005 CT Abd W Cont 51608CTS0011 CT Abd WWO Cont 51608CTS0013 CT Abd WO Cont 51608CTS0023 CT Abd-Ltd Pel W Cont 51608CTS0025 CT Abd-Ltd Pel WO Cont 51608What I want it update it to:code name svctypeRCT0003 AR CT Abd Ltd 19254RCT0005 AR CT Abd W Cont 19254RCT0013 AR CT Abd WO Cont 19254RCT0011 AR CT Abd WWO Cont 19254RCT0023 AR CT Abd-Ltd Pel W Cont 19254RCT0025 AR CT Abd-Ltd Pel WO Cont 19254QUESTION #1:So I am trying to figure out if I could write a statement that basically updates the CODE column’s first three letters in each cell from CTS to RCT and retains the numbers afterwards. QUESTION #2The NAME column in Table 1 would also need a little adjustment. I need to add AR in front (almost like a prefix) of all of the descriptions (so that it looks like Table #2). How do I insert something into the description? I greatly appreciate anyone's help in this. It would save me counltess hours. -T.C. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-18 : 12:45:44
|
| [code]UPDATE svc SET code_name=REPLACE(code_name,'CTS','RCT'), svctype = 'AR '+ svctype[/code] |
 |
|
|
tchelcho
Starting Member
4 Posts |
Posted - 2008-06-18 : 14:37:22
|
| THANK YOU SO MUCH!!! this will save us so much time. Have a great week. |
 |
|
|
|
|
|