| Author |
Topic |
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2012-03-07 : 09:20:44
|
| I have been only importing an entire database. I have one table I have to add to a database. We have the records as flat files and i have creates the columns for this. Now how do I get this into the table? It's about 10 mill records. the thing is also, I only need about 1/7 of them if they are 'price type 15'.They would not fit in an excel. they are sitting in word pad. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2012-03-07 : 11:12:24
|
its flat file here642530333350720001004000000742006425303333508200010040000037100064253033335152000100400000074200642530333351620001004000003710006425303333517200010040000007420064253033335182000100400000371000i have a table ready to receive it. but for some reason this doesn't findBULK INSERT PBM_Price_FDB FROM 'C:\NDC_PRICE.txt' Msg 4860, Level 16, State 1, Line 1Cannot bulk load. The file "C:\NDC_PRICE.txt" does not exist.but i know its there.quote: Originally posted by X002548 what format are they in? What's the record layout. Can you post some sample data. What platform are you on?You can use bcp, BULK INSERT, SSIS..and there are a variety of other hacksBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/
|
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2012-03-07 : 11:18:14
|
| The file must be on the server, not your local driveI guess you could set it up as unc...but I would advice against loading across a networkBut in any case, your file is not delimited so you will need to know the layout of your file and create a format fileOr load it to a single column table and use substring to parse it out. That has the advantage of doing audits against the data before you insert it into it's final resting placecapisce?Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/ |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-07 : 11:22:04
|
| That error message sounds almost like it is exactly the issue Brett identified - that the file must be in the C: drive on the SERVER, not on the C: drive of the client box where you are running SSMS.You can try couple of things:1. Use UNC path instead of drive letter+name2. Check whether the login that you are using to do the bulk insert has access to the location where the file is stored. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2012-03-07 : 11:23:21
|
quote: Originally posted by sunitabeck That error message sounds almost like it is exactly the issue Brett identified - that the file must be in the C: drive on the SERVER, not on the C: drive of the client box where you are running SSMS.You can try couple of things:1. Use UNC path instead of drive letter+name2. Check whether the login that you are using to do the bulk insert has access to the location where the file is stored.
Like I said...not across the network...unless you plan to be trhere for days, and don't mind a hiccup or 2Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/ |
 |
|
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2012-03-07 : 11:26:48
|
| OK I got the file in as one string.Can I parse it out to another table so I can pick out the type 15 ones? |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|