hi
i have split the data using the split command now i want to insert the split data to be inserted into another table. there r many records in the previous table i want each record to be split and inserted into the other table one by one.....
25 123454756741 $GPRMC,093729.000,A,1301.7595,N,08015.2751,E,1.13, 69.84,080210,,*3E,BAUTO 0 3/9/2010 3:07:29 PM
i want to split the underlined data using "," and insert it into another table...
there r many such records i want to split each and every records and insert it to another table
6 3202
Hi there,
i have split the underlined text using c# code now what i want is to insert it to another table but there would be several such records.
i want to split each record n insert it to another table.
Is the text from a table? Or a form?
~~ CK
Hi CK
The text is from a table n not a form.
Here's a pseudo-code...
1.. Parse your string on your SELECT statement using the comma as delimiter/identifier and the dollar sign as the marker to start the parsing.
2.Insert it using the INSERT INTO TABLE .... SELECT col1, ParsedColumnAlias FROM YourTable.
Happy Coding!!!
~~ CK
Try this: Solution 1(Using XQuery Approach) - DECLARE @xml as xml,@str as varchar(100),@delimiter as varchar(10)
-
DECLARE @tblDestination(SplittedRecords varchar(100))
-
-
-
-
SET @str = '25 123454756741 $GPRMC,093729.000,A,1301.7595,N,08015.2751,E,1.13, 69.84,080210,,*3E,BAUTO 0 3/9/2010 3:07:29 PM'
-
SET @delimiter =','
-
SET @xml = cast(('<X>'+replace(@str,@delimiter ,'</X><X>')+'</X>') as xml)
-
INSERT INTO @tblDestination
-
SELECT N.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as T(N)
OUTPUT - 25 123454756741 $GPRMC
-
093729.000
-
A
-
1301.7595
-
N
-
08015.2751
-
E
-
1.13
-
69.84
-
080210
-
-
*3E
-
BAUTO 0 3/9/2010 3:07:29 PM
Hope this helps
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Stu Cazzo |
last post by:
I have the following:
String myStringArray;
String myString = "98 99 100";
I want to split up myString and put it into myStringArray.
If I use this:
myStringArray = myString.split(" ");
it...
|
by: middletree |
last post by:
Not really sure what the problem is, perhaps I am using split wrong.
Page should get form fields form previous page and some of them will go into
a tabel called Personal. Other items, to resolve...
|
by: twdo |
last post by:
Let me see if I can explain my situation clearly.
I have a table with the columns:
answer_id, question_id, member_id, answer
- answer_id is the primary key for the table.
- question_id...
|
by: Willem |
last post by:
Hello
I am quite hopeless and of course a newbe.
The situation: Sql2k / query
I would like it ot break down the following string:
2004 Inventory:Ex.Plant Farm1:1st Cut:Premium:0094
|
by: gotcha |
last post by:
I need to be able to split data such as this in a line:
Part A23423 Price 45.00
into just this A23423 and put that into a form field that I can post.
I have the following code, but I can't...
|
by: bu |
last post by:
I have a database field that represents an item description and varying
length. I am using the database to import the item description into another
program (the other program is ODBC-aware ). The...
|
by: MrHelpMe |
last post by:
Hello again experts,
I have successfully pulled data from an LDAP server and now what I want
to do is drop the data into a database table. The following is my code
that will insert the data but...
|
by: clayalphonso |
last post by:
Here is the code:
<%
dim testArray, testArray2
dim Conn, rs
dim sSQL, sConnString
'response.write request.form("sel1")
'testArray = split(request.form("sel1"),",")
'for each gidstuff In...
|
by: Ben |
last post by:
Hi,
To simplify this request, we supposed this following sql script:
"insert into table a values ('me;you','then'); insert into table a
values ('you;me','so');"
Note the semi-colon ( ; ) in...
|
by: bilgekhan |
last post by:
After doing a succcessful insert() or find() on a set<Tcontainer
is it possible to get the item number of this item in the set?
(ie. its zero-based sequence number (position/location/rank/index)...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |