Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Combine Two Tables 1

Status
Not open for further replies.

HisMightiness

Programmer
Mar 17, 2004
54
US
I am new to SQL Server development, but I use the automated features in Enterprise Manager a lot. :)

I have a table with a specific format already existing in a SQL Server 2000 database. This is generated once a day from a flat file received from an outside vendor. I am now receiving a similar flat file from another vendor which is nearly identical, but with two differences.

First, the new flat file is missing two columns (not critical data).

Next, there is one column that is out of order in comparison to the other flat file (aside from the 2 missing columns).

I need a generic example of how to remove specific records from a table and add these new ones (from the new flat file) through the SQL Server. My intention is to have a job run at a specific time through the SQL Server.

Any help is appreciated. If you know of a good tutorial or something out there, I would be more than happy to check it out. Thank you so much for your help!

Will
 
Books Online is a wonderful resource. You should probably refer to the following items in the "Index" portion of BOL:

Delete, Insert, Update, Views, Select, and Where.

The above are essential parts of the basic T-SQL Statements and you should know them if you intend to do anything with SQL Server. Additionally, SQL Sister has posted a FAQ with recommended books on SQL Faq183-3324. Check it out. It has pretty good documentation references.



Catadmin - MCDBA, MCSA
"Just because I'm paranoid doesn't mean the universe *isn't* out to get me!"
 
look at using DTS - you can select a text file source (then specify the file) then a SQL Server connection then do a transform data task between the two then double click the line created by the transform data task.

Select the destination as the existing sql server table then go to transformations where you can map which field from the source go into which field in the destination.



[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
Your most welcome

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top