How can I pass value from one DB to another

  • Hi all,

     I want to CREATE a DTS in SQL server 2005 & SQL server 2000 , retrieve data from DB1 for example

    select EMPID from tblEmployee where LastModifiedDate >= DateAdd(minute,30,getdate())

    I want  to pass the EMPID  to DB2 in different server & to delete those records

    delete from tblEmployee where EMPID in (sIDs)

    How Can I acheive this DTS  in SQL 2000 & SQL 2005 SERVER, Which controls ve to use?

    Thanks in Advance.Thanks

  • You can use 2 methods.

    Using openrowset whitin a sql query or using a dynamic properties task and assign the value returned by your query "select EMPID from tblEmployee where LastModifiedDate >= DateAdd(minute,30,getdate())" to an environment variable. Then use the environment variable on your other query in the second server.

    if need more info just let me know.

  • HI,

     I already got the solution from another post by saving the query the global variable using script component.Then execute the task from global variable.Thanks

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

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