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.
| Author |
Topic |
|
czeller
Starting Member
10 Posts |
Posted - 2003-07-29 : 15:39:42
|
hi, i'm setting up a web app that allows a user to import a contact list from a text file (csv) to sql server 2000. but that text file doesn't have to fit any given standard, the user defines the contents of file (within allowable table columns of course). the process goes something like this:1 - user uploads file to the server (also identifying delimiter, text-qualifier, etc... on this step)2 - user views a preview of the uploaded file and identify what each column is (first name, last name, email, etc...)3 - user imports data...this is where it gets fuzzy my delima is this. when i go to import the data, how can i use bulk insert w/ a dynamic file? the user may import just the "email" column, or they may import email, name, phone, address (and so on). from what i've read on bulk insert in BOL (new to the whole thing), i can create an .fmt file that basically outlines what i need to import - but won't i need to create an fmt file for every single import? this just seems like a weird process - has anyone dealt with anything like this?at first i was thinking i could just execute a stored proc to do an insert for each row in the uploaded text file...but you start getting into the thousands and yikes! bad idea. we'll probably have people importing lists in the tens of thousands, not huge, but certainly too much to do a row-by-row stored proc!or is this whole idea too much? should i let people import small lists and just do the 'execute a stored proc for each row' solution. and if they want to do a big list (say more than 1000 rows?), have them send us the file? or do i suck it up ( ) and figure out a way to create an fmt file for each import...thanks for your help |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-07-29 : 16:08:15
|
quote: Originally posted by czeller but that text file doesn't have to fit any given standard, the user defines the file... {snip}this just seems like a weird process - has anyone dealt with anything like this?
I would agree, weird to the point of not being supportable, or good design. How will you validate their data, as an example?Much better to force a consistent format and remove a good deal of complexity from your system in the process.Jonathan{0} |
 |
|
|
|
|
|
|
|