各位大虾if exists(select * from sysobjects where name='a1')
 drop table a1
create table a1
(
学号 
姓名 
总分 
等级
)
if exists(select * from sysobjects where name='a2')
 drop table a2
create table a2
(
id 
学号 
总分
)
建立上面两张TABLE后,要想a2中的总分与a1中的总分关联起来,请问如何设置主键和外键~~
还有就是在T-SQL中如何用SQL语句设置各表关系的“创建中检查现存数据”“级联更新相关的字段”“级联删除相关的记录”,小弟跪谢了~~