help,a text how to sql table code ?
If the text is in a file, you can use bcp to import them into a table with
the desired columns. The bcp.exe command line would be similar to the
following (assuming that junk is the table name and junk.txt is the file
containing the text):
cmd>bcp myDB..junk in junk.txt -c -SmyServer -T -t "|"
If the text is already inside a single column in a table, you can use T-SQL
substring(), charindex(), and so on to parse the strings. But that's ugly.
I'd still would just bcp the column out to the file, and bcp the file back
into the table with multiple colunms.
Linchi
|