Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 bulk insert field determinators.

Author  Topic 

yrq
Starting Member

2 Posts

Posted - 2010-11-05 : 18:27:06
I'm working on a school project. The project is to make a procedure that makes real names, in my language. The way it should work is that there's a list of first and last names, with each name there's a chance of that name being chosen (real numbers, from my country). Anyway, doing the project ain't a problem (yet). Starting the project is the problem now.

I have a txt file with list of names, to get them into a table I've been using bulk insert.

bulk insert temptable from 'J:\GSF303\lokaverkefni\drengjanofnunicode.txt' with (ROWTERMINATOR = '\n', FIELDTERMINATOR = '\t' ,DATAFILETYPE = 'widechar')


The problem I'm having is that the list I was given, is not really 100% accurate, some lines have two names in them (about 20-50 out of 1700 lines, not sure).

I think I know why they were set in the same line was the names are very similar, but its not accurate, I've found some samples that show that:
Sævar
SævarrSævin
(if it was accurate these would all be in the same line, not just the later two.)



TLDR;
SO, the question: is there a way to look for a capitalized character in the bulk insert? or is there a good way to run through the list and add a new line?


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-05 : 18:36:22
No and yes.

You'll need to import the data into a staging table and then do manipulation of the data from there.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

yrq
Starting Member

2 Posts

Posted - 2010-11-05 : 18:49:08
I'll try to start on that. Thanks :)
Go to Top of Page
   

- Advertisement -