How to import data from a text file to an already existing table in SQL Server 20005

awarraic
awarraic used Ask the Experts™
on
How to import data from a text file to an already existing table in SQL Server 20005.
I tried "Tasks" --> "Import Data" --> SQL Server Import and Export Wizard.

I didn't find any option where I can choose a destination table. Table already exists but in Wizard, how do I skip column names?

in my text data, I have all the data in the right order.

Example:
abc123,TestLName,TestFName,,Staff,abc123@xxx.edu,12345678,,,,,,,,,,Yes,,123 abc road,San Marcos,TX,487574,NULL,,,,,,,,,,,,,,,,,,LDAP
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I don't have SQL Server, but I know this is possible through a Wizard. An alternative that I know is also possible is to open your csv in Excel and you can simply copy and paste the cells from Excel to sql server when viewing the table data
Hi,

If you have problem using wizard to Import data from Text file then you have second option to import data using "BCP" command.

Commented:
When you're in the import wizard after you choose your destination database, you have a Select Source Tables and Views window.  In the Destination column, change your table name to the table you want to import to.  Then click Edit Mappings. Here you should be able to specify your destination column (make sure Append rows to the destination table is selected).  If you don't want a source column to import, leave it as 'ignore'.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial