如何在ForexRate表中为RateFrom(FK)和&添加记录在表中自动插入货币时的Rateto(FK)?

时间:2014-05-18 12:29:15

标签: sql sql-server database

如何在ForexRate表中为RateFrom(FK)插入记录&在表中自动插入货币时的Rateto(FK)?

表A(货币)

Create table Currency 
( 
CurrencyID int Identity(1,1) Not Null, 
CurrencyName Varchar(50), 
CurrencyCode Varchar(20) Primary Key Not Null 
); 

表B(ForexRate)

Create table ForexRate
( 
RateFrom varchar(20) Foreign key References Currency(CurrencyCode), 
Rateto varchar(20) Foreign key References Currency(CurrencyCode), 
SellRate money, 
BuyRate money 
);

0 个答案:

没有答案