CREATE TABLE [test_key] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[a] [int] NULL ,
[b] [int] NULL ,
[c] [int] NULL ,
CONSTRAINT [test_mkey] PRIMARY KEY  NONCLUSTERED 
(
[id]
)  ON [PRIMARY] ,
CONSTRAINT [test_xkey] UNIQUE  CLUSTERED 
(
[a],
[b],
[c]
)  ON [PRIMARY] 
) ON [PRIMARY]
GO
CREATE TABLE [test_fkey] (
[name] [int] NOT NULL ,
[age] [int] NULL ,
[id] [int] NULL ,
[a] [int] NULL ,
[b] [int] NULL ,
[c] [int] NULL ,
CONSTRAINT [test_fkey_mkey] PRIMARY KEY  CLUSTERED 
(
[name]
)  ON [PRIMARY] ,
CONSTRAINT [test_fkey_fkey] FOREIGN KEY 
(
[id]
) REFERENCES [test_key] (
[id]
)
) ON [PRIMARY]
GO

解决方案 »

  1.   

    触发器好象就是“语句级触发器"
    如果你想取出一条记录的话:
    create ...
    as
    insert 另一个表 select * from inserted或deleted
      

  2.   

    lang_ren(浪人):你写的是建立关联表吧,有些看不懂,是否能解释一下呢。leimin(黄山光明顶):我就是不懂才问的,呵呵。pengdali(大力):是否你能说的详细一些呢,做好写个用例,谢谢。