RT,不过要用T-sql语句查看的
就是说:
create table Course(
Cno char(10),
Cname char(10) constraint Cname_bind not null,
C smallint,
constraint Cno_bind check(Cno between 1 and 1000),
constraint C_bind check(C between 0 and 7)
)
新建了一个表,然后想用语句如何可以查看我所建的约束呢?
就是说:
create table Course(
Cno char(10),
Cname char(10) constraint Cname_bind not null,
C smallint,
constraint Cno_bind check(Cno between 1 and 1000),
constraint C_bind check(C between 0 and 7)
)
新建了一个表,然后想用语句如何可以查看我所建的约束呢?
Name Owner Type Created_datetime
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------------------------- -----------------------
Course dbo user table 2009-12-12 15:41:52.263
Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ----------------------------------- ----------- ----- ----- ----------------------------------- ----------------------------------- ----------------------------------- --------------------------------------------------------------------------------------------------------------------------------
Cno char no 10 yes no yes Chinese_PRC_CI_AS
Cname char no 10 no no no Chinese_PRC_CI_AS
C smallint no 2 5 0 yes (n/a) (n/a) NULL
Identity Seed Increment Not For Replication
-------------------------------------------------------------------------------------------------------------------------------- --------------------------------------- --------------------------------------- -------------------
No identity column defined. NULL NULL NULL
RowGuidCol
--------------------------------------------------------------------------------------------------------------------------------
No rowguidcol column defined.
Data_located_on_filegroup
--------------------------------------------------------------------------------------------------------------------------------
PRIMARY
对象 'COURSE' 没有任何索引,或者您没有所需的权限。
constraint_type constraint_name delete_action update_action status_enabled status_for_replication constraint_keys
-------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------- ------------- -------------- ---------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CHECK on column C C_bind (n/a) (n/a) Enabled Is_For_Replication ([C]>=(0) AND [C]<=(7))
CHECK on column Cno Cno_bind (n/a) (n/a) Enabled Is_For_Replication ([Cno]>=(1) AND [Cno]<=(1000))
没有外键引用表 'COURSE',或者您没有引用表的相关权限。
Table is referenced by views
--------------------------------------------------------------------------------------------------------------------------------
Cno char(10),
Cname char(10) constraint Cname_bind not null,
C smallint,
constraint Cno_bind check(Cno between 1 and 1000),
constraint C_bind check(C between 0 and 7)
)
EXEC SP_HELP COURSE