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 |
justjohno
Starting Member
23 Posts |
Posted - 2006-12-14 : 20:38:57
|
New to T-SQL any help would be appreciated. I need to take first 3 characters of column "a" (xxx-xxxxx-xxx) and put into column "b". Take the next 5 characters from and put into column "C" and take the next 3 characters in put into column "D". If anyone can point me in a direction or help me with this would greatly be appreciated.ThanksJohn O |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2006-12-14 : 21:24:21
|
Look at string functions in Books Online (sql server help). Specifically the function: Substringupdate myTable set [b] = substring(a, 1, 3), [c] = substring(a, 4, 5), etc...Be One with the OptimizerTG |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-14 : 23:24:30
|
1 If it just for display, you can split and show them and no need of other three columns2 If you use front end application, you can use Split function there3 or also read about parsename in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|