Variable data movement

  • Not much of a DTS guy, so any help is much appreciated! Thanx in advance for any help given.

    I have the following tables:

    tblCompany

    id | company | phone

    tblEmployees

    id | companyidfk | fname | lname | phone

    The next step I need is to move the tblEmployees data to a new table. This I know how to do, but the trick is this: If the 'phone' value is NULL or = "", then I want to insert tblCompany.phone value.

    Any ideas how to do this using DTS preferably, or just a stored proc would probably work to...

    Thanx again everyone anyone!

    Mischa

  • Select C.company, E.fname, E.lname, ISNULL(e.Phone, C.phone) as Phone

    from tblCompany C inner join tbkEmployees E on C.id = E.companyidfk

    You just need to apply this technique to the insert/update statement you will be using to transfer the data.

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

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