Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting Rows from Text Field

Status
Not open for further replies.

jschodde

Technical User
Jan 28, 2001
42
US
I have a table that contains a unique key and a text field. The text fields contains part numbers of different lengths like:

key part_numbers
----- ------------
1 99
999
9999
2 99999
99
9999

Over time, the length of each part number could get longer.

With that in mind, I want to create a new RECORD for each part number like this:

key part_numbers
----- ------------
1 99
1 999
1 9999
2 99999
2 99
2 9999

Thanks,
Jeff
 
What detemines that the second and third rows are key 1 ?

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
The "key" field in that case would not be unique (my mistake).

What would determine the "key" field value?: If I were to write some kind of stored procedure, I envision looping through each row of the text field and inserting rows into a cursor or some other table.

I'm not sure a simple T-SQL statement could be used in this case.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top