I have two tables with different database:
- AccntID from table 'account' <--database name 'ECPNWEB'
- AccountTID from table 'tblPolicy' <--database name 'GENESIS'
Now I want to insert 'tblPolicy' like this: <--database 'GENESIS'
INSERT INTO dbo.tblPolicy
(
PolicyID ,
AccountTID ,
DistributorID ,
CARDNAME ,
DENOMINATION ,
RETAILPRICE ,
COSTPAYABLE ,
ECPAYFEES ,
PLUCODE
)
-- Insert statements for procedure here
select t.* from
(Select AccountTID=@AccntID, DistributorID=@DistributorID, CARDNAME=@CARDNAME, DENOMINATION=@DENOMINATION, RETAILPRICE=@RETAILPRICE, COSTPAYABLE=@COSTPAYABLE, ECPAYFEES=@ECPAYFEES, PLUCODE=@PLUCODE) t,
account a
where a.AccntID = t.AccountTID --for account
Now what I want to do is to insert this "ONLY" to tblPolicy connected with the 'account' table with different database 'GENESIS'