Link to home
Start Free TrialLog in
Avatar of 2326ac
2326ac

asked on

SQL 2000 - Need to update information from a different database (same instance)

Hi,

I have two database in the same instance.  1 called SD the other called CRDB.

SD has 3 fields I am interested in.  Forname, Surname and Email.  I need to create a query or stored proceedure that will take all the fields from this table and update them in a different database. But.... in CRDB the destination) I need the Fiorname and Surname to be together into a WholeName field (Forname + ' ' + Surname) and the email field to be to populated with the first letter of the forname, the whole surname field '@domain.co.uk'

Can anyone please advise me on this.  If you need me to be more clear, please say and I will be more detailed.  it is very simply what I am trying to do
Avatar of Lukasz Zielinski
Lukasz Zielinski
Flag of Poland image

you have to different databases or tables?

ziolko.
Avatar of gjutras
gjutras

insert into CRDB.newtable (wholename,email) select forname + ' ' + surname as wholename, left(forname,1) + surname + '@domain.co.uk' as email from sd.oldtable;
ASKER CERTIFIED SOLUTION
Avatar of Yveau
Yveau
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial