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 |
|
reddy_vam
Starting Member
43 Posts |
Posted - 2009-10-16 : 00:35:32
|
| I have table with having numeric values in a column like shown below.ID---1234124546126575712090989I want to replace first 2 numeric values with another number, so that output will be likeID---5634564546566575756090989Somebody help me with the command please?Thanks,Vamshi |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2009-10-16 : 00:47:11
|
| Try using one of the LEFT or RIGHT functions... perhaps in combination with LEN.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-10-16 : 01:04:39
|
The first question is what data type is the column ID?The second question is if there is a condition to change the value or not?The third question is if there are related records in other tables to this IDs? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-10-16 : 04:12:12
|
| select col, stuff(col,1,2,'56') from your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|