Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Friday, March 30, 2012

import question

I have a excel comma seperated file with 2 columns.

Column A contains names and Column B contains zips.

The problem is Column A is not consistent in it's structure. Some columns only contain one name where others contain two names just by last name seperated by a space or a slash.

For example

BOWERING WILKENSON
GEERS/DOODS

I'm trying to clean the data before importing into a sql table. I want to seperate the records for column A where there are two names and move the second name to a new row. Is there a method to do this during the import? Or, within Excel prior to the import using replace? I want to find instances where there is a space or slash and move the name after the space or slash and move to a new row?

Thanks,
-D-I think in Excel you can do a text to column and put "/" or space as the delimitter|||Instead of leaning up just import the fist column in a temporary table and clean it by using substring and charindex.

Wednesday, March 21, 2012

Import directory structure to table

I need to be able to import a directory file list into a sql table.
i.e. table contains fields for filename, date etc...
is this possible?
thanks?absolutely. you are going to have to use file system objects with sp_OACreate. A solution was posted here a long time ago but the thread may have been lost when the server crashed.|||absolutely. you are going to have to use file system objects with sp_OACreate. A solution was posted here a long time ago but the thread may have been lost when the server crashed.

Nah...

http://weblogs.sqlteam.com/brettk/archive/2005/06/28/6895.aspx|||That lastone works Brett, but I can't get it to traverse sub-directories

what I am trying to do is index a hard drive of images for a real estate database.|||Drawback of letting SQL Server do this is that the directory must be on de server of SQL has to have access to remote locations.

My first instinct would have been to write a vbs-script (with a filesystemobject and ado connection) that scans the directories and inserts them in the table. This script could be run from any computer that has network access to the SQL Server.|||Lexiflex, the SQL server has access to the iages via a maped drive.

We will use this to link the image to the realtor, the listing and image history. The idea is that we want to be able to take image submissions, identify if there already are images for the property, if not add it to the listing, if there is add a flag to the listing indicating a change etc...

there is another app run from a web page that automatically places the images in the folder, and names, numbers them appropriatly|||So it should be possible to do this in SQL server.

Just curious: How do you identify which newly found image belongs to what property? And do you keep the images on the filesystem or do you import them in the database?|||The images are named with the ListingID#, and are stored in the file system.|||Good luck with this project! It's always fun to build something and see it at work afterwards. :)|||well, just iterate through the Directory table until @.@.ROWCOUNT = 0

Friday, February 24, 2012

import a large table

Hi,
I am importing a large table to a table. The table contains
27 millions rows with 1 or 2 index.
I used Enterprise Manager to do the table import. I see
the "status: 275" on the import screen after 27 millions
rows are inserted. The "status: 275" is on the screen
for 4 hours already. I used "simple" option for the
recovery.
Does import should take more than 10 hours for a 27
millons rows ?
Is there a way which I can use to make import faster,
e.g. command line import option ?
Thanks in advance.
MingTry using bcp to export the data to a file and import from
the file. Use the native format (/N).
Also set batch size.
Create the indexes after the import.
>--Original Message--
>Hi,
>I am importing a large table to a table. The table
contains
>27 millions rows with 1 or 2 index.
>I used Enterprise Manager to do the table import. I see
>the "status: 275" on the import screen after 27 millions
>rows are inserted. The "status: 275" is on the screen
>for 4 hours already. I used "simple" option for the
>recovery.
>Does import should take more than 10 hours for a 27
>millons rows ?
>Is there a way which I can use to make import faster,
>e.g. command line import option ?
>Thanks in advance.
>Ming
>.
>