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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-11 : 08:13:14
|
| Kush writes "hi therei have a field name(fil_srt_cond) with the values ofcmpnt_name,ASC,10,2;cmpnt_stuff,DESC,2,3;...........how can i get the data after the comma;cmpnt_name - Tag Numberorder - ASCChar - 10lenght - 2so i can display them on a report with their respective column heading. thank you for your help" |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2005-10-11 : 09:03:11
|
| Lookup: SUBSTRING, PATINDEX, CHARINDEX |
 |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2005-10-11 : 09:09:34
|
Please tell me you did not design this data storage.First I would bulk import into a table to split out each row at ;. Then you can use charIndex with substring to break it into columns. I would then save it into a new table for actual use. JimUsers <> Logic |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-10-11 : 09:31:45
|
| bcp the data outbcp it back in to a staging table use ';' as the delimiterbcp the data back outbcp the data back in using "," comma as the delimter..Done, Normalized (I guess)Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-10-11 : 09:40:54
|
| "how can i get the data after the comma"What about the stuff after the semi colon - is that to be ignored, or treated as "row 2" ??Kristen |
 |
|
|
|
|
|