Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Checking 2 columns in 2 tables row by row using ssis

Posted on 2008-06-11
1
Medium Priority
?
223 Views
Last Modified: 2011-10-19
hi,
i have 2 tables   A and B. i attached a file below.
i have a task to check each value of column A with each value of column B.
iF if value 30 exist in A and Not present in B.
we should get  a result set "30 deleted from A". and if New values found in B it should be entered into other resultset.
I am trying to work it out through SQL server 2005 or SSIS
i am not able to find a way.
please help
New-Text-Document.txt
0
Comment
Question by:kgadde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
howyue earned 750 total points
ID: 21766033
ur question sounds to me like a synchronization between 2 tables. there are many ways of doing this, based on ur situation, for example using TableDiff provided by sql 2005, using 3rd party program, using storedprocedure or query. i did once before using storedprocedure synchronizing 2 database in different region using linked server, which suited my circumstance.

to give u a rough idea how to do it in query, check out my sample code.
/* Get whatever value exist in table A but not table B */
INSERT INTO B
SELECT A.Value 
FROM A
LEFT JOIN B 
	ON A.Value = B.Value /* u need to specify all the columns to compare here */
WHERE B.Value IS NULL
/* Get whatever value exist in table B but not table A */
INSERT INTO A
SELECT B.Value 
FROM B
LEFT JOIN A
	ON A.Value = B.Value /* u need to specify all the columns to compare here */
WHERE A.Value IS NULL

Open in new window

0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question