473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help parsing field

hi..i need help for my exam, I retrived data from my sms inbok and
insert to table.The record just like this:
ID1,12x100,56x12,90x90..,how to pars the table in to:
ID First Second
ID1 12 100
ID1 56 12
ID1 90 90

Thank for your help...

===================

May 13 '07 #1
3 1266
Using a table of numbers

http://sqlserver2000.databases.aspfa...ers-table.html
CREATE TABLE MyTable(ID VARCHAR(4), Data VARCHAR(100))
INSERT INTO MyTable(ID, Data) VALUES('ID1','12x100,56x12,90x90')

SELECT ID,
PARSENAME(REPLACE(Data,'x','.'),2) AS First,
PARSENAME(REPLACE(Data,'x','.'),1) AS Second
FROM (
SELECT ID,
SUBSTRING(Data ,
Number,
CHARINDEX(',' ,
Data+',' ,
Number)-Number) AS Data
FROM MyTable
INNER JOIN Numbers ON Number BETWEEN 1 AND LEN(Data)+1
AND SUBSTRING(','+Data,Number,1) = ',') X
ORDER BY ID
May 13 '07 #2
you the best ,thx.
if data inserted to table about 100 data/sec,is the script run well in
this condition, and no data lost or error??

May 13 '07 #3
ne**********@gmail.com wrote:
if data inserted to table about 100 data/sec,is the script run well in
this condition, and no data lost or error??
The best way to find out is to actually set up a test.

I've seen the following method used in production systems; it avoids
forcing the insert process to wait for an immediate response, and also
allows trying again later in case of problems.

* insert the data into an intermediate table with a column indicating
order of insertion
* separate process, launched on a schedule or by a human operator:
- note the most recent record that exists
- process all rows up to and including that one, either deleting
them or marking them as already processed
- any rows inserted mid-process are left for the next launch
May 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dennis Roberts | last post by:
I have a script to parse a dns querylog and generate some statistics. For a 750MB file a perl script using the same methods (splits) can parse the file in 3 minutes. My python script takes 25...
3
by: Jay | last post by:
I previously posted this question under Visual Basic newsgroup, but was advised to re-post here. I'm hoping someone can help me solve an issue I'm having with VB.Net and Access 2000. Here's...
2
by: Joey Martin | last post by:
I have been reading documentation on parsing. I need some help though. I have the following in a text file: $650 Number of Bedrooms 3 Air Conditioning? Yes Original Ad SOUTH, 3BR, air, basement....
0
by: milesd | last post by:
Hi, Rather new to MSXML4. I am parsing an XML data-stream over HTTP, and would like to know why I cannot parse XML nodes with multiple parameters. The XML and Code are below, BUT I would like...
7
by: William Gill | last post by:
I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID) Cursor.execute(sql) it works fine, but when I try : sql=...
19
by: asrs63 | last post by:
Hi, Is there a class that can handle splitting of a string on a comma such that the commas in quotes are ignored? I know we can use Text::ParseWords directive in perl to do this, but I am new...
6
by: drec | last post by:
I am just learning Javascript and I would like to create a basic form that gives me two options. This will be using either checkbox or radio input type, however I would like the second option to...
9
by: Paulers | last post by:
Hello, I have a log file that contains many multi-line messages. What is the best approach to take for extracting data out of each message and populating object properties to be stored in an...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
4
by: KrazyKasper | last post by:
I'm a Novice User using Access 2003 Tables are via ODBC (i.e., cannot alter fields) I have a report that uses the field OrderRepName (text string) and is formatted as lastname, firstname,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.