Red Gate forums :: View topic - CSV import not working
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

CSV import not working

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
pk_davidson



Joined: 06 Nov 2012
Posts: 8

PostPosted: Fri Nov 16, 2012 2:11 am    Post subject: CSV import not working Reply with quote

I have a very simple table (many to many) that I am trying to populate from a csv file. There are only 5 columns.
Primary Key, Foreign Key 1, Foreign Key 2, LastUpdateBy, LastUpdate

I run the SQL Data Generator, select the csv file, go through the mapping and click the Red Button Generate Data.

What happens is that random data is put into the table.
This is what I see in the lower half of your program.
This lower data never changes from random data.
And yes, I have selected to use a csv file....

Frustrated at such a simple task.
Thanks
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6649

PostPosted: Mon Nov 19, 2012 3:19 pm    Post subject: Reply with quote

If you select a CSV file as a data source for a table, that makes it possible for you to choose the columns from the CSV to supply values for the columns of generated data. You then must select the column settings in SQL Data Generator, and pick the CSV as the generator, choosing the column from the CSV that you want to map to the column in the generated data.

If you do not select the column from the CSV, then SQL Data Generator will continue using the default generator for the column.
Back to top
View user's profile Send private message
pk_davidson



Joined: 06 Nov 2012
Posts: 8

PostPosted: Mon Nov 19, 2012 5:27 pm    Post subject: Reply with quote

I'll look at it again Brian.
But sure thought I had everything selected correctly...
Back to top
View user's profile Send private message
pk_davidson



Joined: 06 Nov 2012
Posts: 8

PostPosted: Mon Nov 19, 2012 7:34 pm    Post subject: Reply with quote

Brian:
I see no where to select columns.
I went through the Use existing data source, browsed to the CSV file, made sure the columns were mapped correctly to the appropriate data types. I can see the data read correctly in the CSV File Data Import Settings dialog box. But when I click Finish, the preview of data is still showing random data and if I click Generate Data, it will import the random data, not the csv data.

I've read through help, searched this forum and nothing seems to work.

I click on a column in Tables to Populate and look at the Column generation settings and the only option I have for the two foreign key fiels is Foreign Key generator. I want to read those from a CSV file!

I can set a string and date field by click on the columns and going through the entire browse and map again but this begs the question, why did I did it in the first place for the table in the first place ?

It appears that the populate from csv will not populate FK fields ?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6649

PostPosted: Tue Nov 20, 2012 10:08 am    Post subject: Reply with quote

There are some types of fields where you can't change the generator type, such as some foreign key fields. Is that the problem? If so, you're rather stuck. SDG sometimes tries to prevent you from doing things that won't work.
Back to top
View user's profile Send private message
hotlazydaze



Joined: 26 Mar 2013
Posts: 2
Location: Singapore

PostPosted: Tue Jun 10, 2014 10:57 am    Post subject: Also can't get csv import to work Reply with quote

Did anyone work this out? The csv import function does not work. I select the csv file and then on step one I choose the delimiter and below it shows me how it should look and everything seems fine so I click next and leave the column types as automatic but as soon as you click finish and the dialog closes the sample set is still dynamic and not related to the csv file. Then if you click generate the data that's imported bears no resemblance to the csv data.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group