use cursor or DTE for employee updates functionality

  • Dear all, Please help

    well i end my life with one requirement.

    Scenario: I have two tables ( major emp details and temp emp details) holds employee information.

    Major employee details table holds information w.r.t to specific database and temp employee details tables holds updated employee information whose data is pushed by some SSIS package.

    Requirement:

    i want to write such procedure which display only those employee details whose details are updated from major emp details table to temp employee details table

    To test:

    --create major emp dtls table which holds infor

    create table temp1empdtls(empno int,empname varchar(50),age int)

    insert into temp1empdtls values(11,'John','38')

    insert into temp1empdtls values(12,'Eric','20')

    insert into temp1empdtls values(13,'Adam','40')

    select * from temp1empdtls

    --create temp emp dtls table whose details are loaded by SSIS package with some datasources

    create table temp2empdtls(empno int,empname varchar(50),age int)

    insert into temp2empdtls values(11,'John','39')

    insert into temp2empdtls values(12,'Eric-delight','22')

    insert into temp2empdtls values(13,'Adam','40')

    select * from temp2empdtls

    --drop all tables

    drop table temp1empdtls

    drop table temp2empdtls

    --Desired output: should be only two records as these details are updated comparitively

    empno empname age

    11John 39

    12Eric-delight 22

    Please help me in this!!

  • Duplicate post, and another.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply