• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1171
  • Last Modified:

Need a sql query to parse ntext column with distinct delimiters in the ntext value

Hello Experts,

I have a table with an ntext column as it's too big to be a varchar.

I have to parse through the ntext column and grab the data, and put it into normalised tables.

The data looks like this:
-----------------***********************-----------------

License Key                         = 50222249089062708117955
Product Name                        = VERITAS File System
Key                                 = Invalid,  Expired
License Type                        = DEMO
Demo End Date                       = Sun Sep 19 04:00:00 2004
Site License                        = YES

Features :=
VXFS                                = Enabled


-----------------***********************-----------------

License Key                         = 00194956550480519594652
Product Name                        = VERITAS File System
Key                                 = Invalid,  Expired
License Type                        = DEMO
Demo End Date                       = Sun Oct 24 04:00:00 2004
Site License                        = YES

Features :=
VXFS                                = Enabled


-----------------***********************-----------------

License Key                         = R8PG-OMNP-6CRU-PPPP-XU3N-D2OP-PPRP-P36
Product Name                        = VERITAS Volume Manager
Serial Number                       = 17615
License Type                        = PERMANENT_NODE_LOCK
OEM ID                              = 22
Node Lock Type                      = (Hostid and Architecture ID)

Features :=

VxVM                                = Enabled
CPU Count                           = Not Restricted
Platform                            = un-used
Version                             = un-used


-----------------***********************-----------------


..and it's not terribly consistent either. (The above is just a small fragment for an example)

What IS consistent with the data in the ntext column however is that sections of it are separated by the -----------------***********************----------------- thing.

What do you think is the best way to parse through this and pull out the data items with their relevant values?

I have to do it on SQL, but it's coming from a text file so maybe there's a better way?

As ever, super urgent!!!!

Thanks,
rss2
0
rss2
Asked:
rss2
1 Solution
 
BrandonGalderisiCommented:
If you can parse the text file with some type of scripting language (like vbscript or javascript) you can probably handle it MUCH better.  You can do a split on the _______*************__________ line to break it into smaller sections.  Then from there read line by line to break up the fields.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what version of sql server?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now