Author |
Topic |
spatrick
Starting Member
4 Posts |
Posted - 2007-07-13 : 12:16:48
|
Hello, Let get right to it, OK?Setup:Windows 2003 web edition w/ SQL ExpressProblem:Error when importing text file to SQL Express. Not sure about the quality of the data since it is from a 3rd party and has over 1700 rows but it imports in to MS Access with no problems.Error:Unable to open BCP host data-fileCommand:bcp MLS_Data.dbo.tblFL_PuntaGorda in C:\Inetpub\AdminScripts\DL_MLS\puntagorda_data.txt -T -S.\SQLEXPRESS -f FL_PuntaGorda_bcp.fmtFormat File:9.0881 SQLCHAR 0 1 "\"" 0 Quote SQL_Latin1_General_CP1_CI_AS2 SQLCHAR 0 50 "\",\"" 1 MLS_ID SQL_Latin1_General_CP1_CI_AS3 SQLCHAR 0 50 "\",\"" 2 MLS_STATE_ID SQL_Latin1_General_CP1_CI_AS4 SQLCHAR 0 50 "\",\"" 3 MLS_LISTING_ID SQL_Latin1_General_CP1_CI_AS5 SQLCHAR 0 50 "\",\"" 4 TLN_FIRM_ID SQL_Latin1_General_CP1_CI_AS6 SQLCHAR 0 150 "\",\"" 5 MLS_OFFICE_NAME SQL_Latin1_General_CP1_CI_AS7 SQLCHAR 0 50 "\",\"" 6 MLS_OFFICE_PHON SQL_Latin1_General_CP1_CI_AS8 SQLCHAR 0 50 "\",\"" 7 TLN_REALTOR_ID SQL_Latin1_General_CP1_CI_AS9 SQLCHAR 0 50 "\",\"" 8 MLS_AGENT_NAME SQL_Latin1_General_CP1_CI_AS10 SQLCHAR 0 50 "\",\"" 9 MLS_AGENT_PHONE SQL_Latin1_General_CP1_CI_AS11 SQLCHAR 0 50 "\",\"" 10 LISTING_DATE SQL_Latin1_General_CP1_CI_AS12 SQLCHAR 0 50 "\",\"" 11 LISTING_EXPIRATION_DATE SQL_Latin1_General_CP1_CI_AS13 SQLCHAR 0 50 "\",\"" 12 SOLD_DATE SQL_Latin1_General_CP1_CI_AS14 SQLCHAR 0 50 "\",\"" 13 AVAILABLE_DATE SQL_Latin1_General_CP1_CI_AS15 SQLCHAR 0 50 "\",\"" 14 PROPERTY_TYPE_CODE SQL_Latin1_General_CP1_CI_AS16 SQLCHAR 0 50 "\",\"" 15 PROP_TYPE_DESCRIPTION SQL_Latin1_General_CP1_CI_AS17 SQLCHAR 0 16000 "\",\"" 16 REMARKS SQL_Latin1_General_CP1_CI_AS18 SQLCHAR 0 50 "\",\"" 17 STATUS_CODE SQL_Latin1_General_CP1_CI_AS19 SQLCHAR 0 50 "\",\"" 18 SALE_PRICE SQL_Latin1_General_CP1_CI_AS20 SQLCHAR 0 50 "\",\"" 19 SOLD_PRICE SQL_Latin1_General_CP1_CI_AS21 SQLCHAR 0 50 "\",\"" 20 PROPERTY_STATE_ID SQL_Latin1_General_CP1_CI_AS22 SQLCHAR 0 50 "\",\"" 21 STREET_NUMBER SQL_Latin1_General_CP1_CI_AS23 SQLCHAR 0 50 "\",\"" 22 STREET_NAME SQL_Latin1_General_CP1_CI_AS24 SQLCHAR 0 50 "\",\"" 23 STREET_TYPE SQL_Latin1_General_CP1_CI_AS25 SQLCHAR 0 50 "\",\"" 24 STREET_DIRECTION SQL_Latin1_General_CP1_CI_AS26 SQLCHAR 0 50 "\",\"" 25 UNIT_NUMBER SQL_Latin1_General_CP1_CI_AS27 SQLCHAR 0 50 "\",\"" 26 LONGITUDE SQL_Latin1_General_CP1_CI_AS28 SQLCHAR 0 50 "\",\"" 27 LATITUDE SQL_Latin1_General_CP1_CI_AS29 SQLCHAR 0 50 "\",\"" 28 CITY SQL_Latin1_General_CP1_CI_AS30 SQLCHAR 0 50 "\",\"" 29 CITY_ID SQL_Latin1_General_CP1_CI_AS31 SQLCHAR 0 50 "\",\"" 30 ZIP_CODE SQL_Latin1_General_CP1_CI_AS32 SQLCHAR 0 50 "\",\"" 31 ZIP_PLUS4 SQL_Latin1_General_CP1_CI_AS33 SQLCHAR 0 50 "\",\"" 32 MLS_AREA SQL_Latin1_General_CP1_CI_AS34 SQLCHAR 0 50 "\",\"" 33 COUNTY SQL_Latin1_General_CP1_CI_AS35 SQLCHAR 0 50 "\",\"" 34 FIPS_COUNTY_CODE SQL_Latin1_General_CP1_CI_AS36 SQLCHAR 0 50 "\",\"" 35 SUBDIVISION SQL_Latin1_General_CP1_CI_AS37 SQLCHAR 0 50 "\",\"" 36 COMMUNITY_NAME SQL_Latin1_General_CP1_CI_AS38 SQLCHAR 0 50 "\",\"" 37 YEAR_BUILT SQL_Latin1_General_CP1_CI_AS39 SQLCHAR 0 50 "\",\"" 38 ACRES SQL_Latin1_General_CP1_CI_AS40 SQLCHAR 0 50 "\",\"" 39 LOT_DIMENSIONS SQL_Latin1_General_CP1_CI_AS41 SQLCHAR 0 50 "\",\"" 40 LOT_SQUARE_FOOTAGE SQL_Latin1_General_CP1_CI_AS42 SQLCHAR 0 50 "\",\"" 41 LOT_SQUARE_FOOTAGE_LAND SQL_Latin1_General_CP1_CI_AS43 SQLCHAR 0 50 "\",\"" 42 BUILDING_SQUARE_FOOTAGE SQL_Latin1_General_CP1_CI_AS44 SQLCHAR 0 50 "\",\"" 43 BEDROOMS SQL_Latin1_General_CP1_CI_AS45 SQLCHAR 0 50 "\",\"" 44 BATHS_TOTAL SQL_Latin1_General_CP1_CI_AS46 SQLCHAR 0 50 "\",\"" 45 BATHS_FULL SQL_Latin1_General_CP1_CI_AS47 SQLCHAR 0 50 "\",\"" 46 BATHS_HALF SQL_Latin1_General_CP1_CI_AS48 SQLCHAR 0 50 "\",\"" 47 BATHS_THREE_QUARTER SQL_Latin1_General_CP1_CI_AS49 SQLCHAR 0 50 "\",\"" 48 FIREPLACE_NUMBER SQL_Latin1_General_CP1_CI_AS50 SQLCHAR 0 50 "\",\"" 49 TOTAL_ROOMS SQL_Latin1_General_CP1_CI_AS51 SQLCHAR 0 50 "\",\"" 50 SCHOOL_DISTRICT SQL_Latin1_General_CP1_CI_AS52 SQLCHAR 0 50 "\",\"" 51 SCHOOL_ELEMENTARY SQL_Latin1_General_CP1_CI_AS53 SQLCHAR 0 50 "\",\"" 52 SCHOOL_MIDDLE SQL_Latin1_General_CP1_CI_AS54 SQLCHAR 0 50 "\",\"" 53 SCHOOL_JUNIOR_HIGH SQL_Latin1_General_CP1_CI_AS55 SQLCHAR 0 50 "\",\"" 54 SCHOOL_HIGH SQL_Latin1_General_CP1_CI_AS56 SQLCHAR 0 50 "\",\"" 55 TOTAL_UNITS SQL_Latin1_General_CP1_CI_AS57 SQLCHAR 0 50 "\",\"" 56 TOTAL_BUILDINGS SQL_Latin1_General_CP1_CI_AS58 SQLCHAR 0 50 "\",\"" 57 TOTAL_LOTS SQL_Latin1_General_CP1_CI_AS59 SQLCHAR 0 50 "\",\"" 58 HOA_FEES SQL_Latin1_General_CP1_CI_AS60 SQLCHAR 0 50 "\",\"" 59 OWNERS_NAME SQL_Latin1_General_CP1_CI_AS61 SQLCHAR 0 750 "\",\"" 60 LEGAL SQL_Latin1_General_CP1_CI_AS62 SQLCHAR 0 50 "\",\"" 61 APN SQL_Latin1_General_CP1_CI_AS63 SQLCHAR 0 50 "\",\"" 62 TAXES SQL_Latin1_General_CP1_CI_AS64 SQLCHAR 0 50 "\",\"" 63 TAX_YEAR SQL_Latin1_General_CP1_CI_AS65 SQLCHAR 0 50 "\",\"" 64 SECTION SQL_Latin1_General_CP1_CI_AS66 SQLCHAR 0 50 "\",\"" 65 RANGE SQL_Latin1_General_CP1_CI_AS67 SQLCHAR 0 50 "\",\"" 66 TOWNSHIP SQL_Latin1_General_CP1_CI_AS68 SQLCHAR 0 50 "\",\"" 67 RENT_ON_SEASON SQL_Latin1_General_CP1_CI_AS69 SQLCHAR 0 50 "\",\"" 68 RENT_OFF_SEASON SQL_Latin1_General_CP1_CI_AS70 SQLCHAR 0 50 "\",\"" 69 PHOTO_IND SQL_Latin1_General_CP1_CI_AS71 SQLCHAR 0 50 "\",\"" 70 LAST_MLS_UPDATE_DATE SQL_Latin1_General_CP1_CI_AS72 SQLCHAR 0 50 "\",\"" 71 MASTER_BED SQL_Latin1_General_CP1_CI_AS73 SQLCHAR 0 50 "\",\"" 72 BED2 SQL_Latin1_General_CP1_CI_AS74 SQLCHAR 0 50 "\",\"" 73 BED3 SQL_Latin1_General_CP1_CI_AS75 SQLCHAR 0 50 "\",\"" 74 BED4 SQL_Latin1_General_CP1_CI_AS76 SQLCHAR 0 50 "\",\"" 75 BED5 SQL_Latin1_General_CP1_CI_AS77 SQLCHAR 0 50 "\",\"" 76 KITCHEN SQL_Latin1_General_CP1_CI_AS78 SQLCHAR 0 50 "\",\"" 77 BREAKFAST SQL_Latin1_General_CP1_CI_AS79 SQLCHAR 0 50 "\",\"" 78 LAUNDRY SQL_Latin1_General_CP1_CI_AS80 SQLCHAR 0 50 "\",\"" 79 DEN SQL_Latin1_General_CP1_CI_AS81 SQLCHAR 0 50 "\",\"" 80 DINING SQL_Latin1_General_CP1_CI_AS82 SQLCHAR 0 50 "\",\"" 81 FAMILY SQL_Latin1_General_CP1_CI_AS83 SQLCHAR 0 50 "\",\"" 82 LIVING SQL_Latin1_General_CP1_CI_AS84 SQLCHAR 0 50 "\",\"" 83 GREAT SQL_Latin1_General_CP1_CI_AS85 SQLCHAR 0 50 "\",\"" 84 EXTRA SQL_Latin1_General_CP1_CI_AS86 SQLCHAR 0 16000 "\",\"" 85 FEATURE_CODES SQL_Latin1_General_CP1_CI_AS87 SQLCHAR 0 50 "\",\"" 86 MLS_OFFICE_ID SQL_Latin1_General_CP1_CI_AS88 SQLCHAR 0 50 "\",\"" 87 MLS_AGENT_ID SQL_Latin1_General_CP1_CI_AS89 SQLCHAR 0 200 "\"\r\n" 88 VIRTUAL_TOUR_URL SQL_Latin1_General_CP1_CI_ASPlease help,Shawn |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-07-13 : 12:19:00
|
You might want to use a different delimiter... Check if your actual data has this delimiter in any of its columns which could be throwing off the import by a column.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
spatrick
Starting Member
4 Posts |
Posted - 2007-07-13 : 12:55:48
|
Thanks for taking the time to reply. It wouldn't matter if there were commas in the data itself because I can not do anything about it. The data comes from a 3rd party source which each record is entered in by several hundred people. I have to work with the data as-is. Any aternative method that is automated I am open to suggestions. I will be receiving this type of date every day from several sources. Needs to be automated.Thanks,Shawn |
 |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-07-13 : 13:02:37
|
Based on the data you have so far (over time) you probably can identify some special character like ~ or ^ that is not used in the data file. Try using that delimiter. Can you provide some sample data so we can see how the data looks like,..Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
spatrick
Starting Member
4 Posts |
Posted - 2007-07-13 : 13:25:01
|
One row of data:"puntagorda","FL","662658","586614","Exit Realty Foundations","9417643948","1297018","Barkhurst,Judith","","","","","","S","Ranch","Just bring your toothbrush and move into this beautiful, almost turnkey, 3/2/2 home with a beautiful pool and large lanai. You will love living in this wonderful home is such a nice, quiet neighborhood close to shopping and all the other conveniences. DON T MISS OUT ON THIS RARE OPPORTUNITY!","A","219900","","FL","717","RED BAY ST","","","","","","Port Charlotte","Y22737","33948","","P101-Port Charlotte SW of 41","Charlotte","12015","PCH","","1988","","80x127 x 80x127","","","1459","3","2","2","0","","0","","","Meadow Park","Murdock","","Port Charlotte","","","","0","","PCH 023 0734 0009 PORT CHARLOTTE SEC23 BLK734 LT9455/ 920 620/2110 652/2028 974/1050 2287 /620 2589/34","","2652","2006","9455","","","","","X","","11 x 15","10 x 11","10 x 11","","","11 x 17-5","8 x 11","4-10 x 10","","","","0x0","18-3 x 20-5","","A05,E05,E23,J02,J08,M01,M05,N07,N10,N11,N13,N18,N19,N24,O03,O09,O14,O15,O18,O22,Q04,Q08,R05,S41,T08,T23,T32,U01,U04,W12,W27,W45,Y25,Z07,Z09","","",""One option could be to do a find and replace with ASP before running BCP. Hopefully I do not have to do that, it's just one more step I got to worry about. |
 |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-07-13 : 14:11:06
|
If you cannot change the data, use a staging table to import into first, manually do some data fixes for data that did not get imported.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
spatrick
Starting Member
4 Posts |
Posted - 2007-07-13 : 14:21:17
|
Alright, I know I can import this data as-is into MS Access but I did it manually with the import wizard in MS Access. Is there command line tool or .dll I can use to automate this task. Once I have it MS Access what is the automated proceudre to import from MS access to SQL Express. I know I can do it manually but rememeber I will receive several of these text files every night around 2AM. I don't know about you but I am usually catching some z's about that time. Any help would be grateful.Thanks so far,Shawn |
 |
|
|
|
|