)-- 表名 set @table_name='bqcform101' --============表结构 select 类别,表名or字段名,描述,字段类型,是否自增,允许为NULL,默认值 from ( column_id,tbs.name 表名or字段名,ds.value 描述, rn FROM sys.extended_properties ds LEFT JOIN sysobjects tbs ON ds.major_id=tbs.id and tbs.name=@table_name
命令 show create table game; game是表名 在web管理中,请在sql标签中查,不要在query中执行. show create table game; === <Result of SELECT Command in Line 1> === TABLE CREATE TABLE ============================================ 'game' 'CREATE TABLE game ( host_year INTEGER NOT
ORACLE: 1.查主键名称: select * from user_constraints where table_name = 'AAA' and constraint_type ='P'; 查主键对应的列: select * from user_cons_columns where table_name = 'AAA' and constraint_name = 'PK_AAA'; (PK_AAA 是主键名) 2.查索引名称: select * from user_indexes whe
DECLARE CURSOR tab_name_cur IS SELECT table_name FROM user_tables WHERE table_name LIKE 'GZD_GZDXX_%_2017'; tab_name_rec tab_name_cur%ROWTYPE ; SQL_Str_Create VARCHAR2(2500); SQL
来源于网上整理 总结了一下oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下,希望对大家有所帮助: 1.查询出所有的用户表select * from user_tables 可以查询出所有的用户表select owner,table_name from all_tables; 查询所有表,包括其他用户表 通过表名过滤需要将字母作如下处理 select * from user_tables where table_name = upper('表
--查询某个表是否有唯一主键 select cu.* from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'P' and au.table_name ='表名' --查询某个表是否有联合主键 select cu.* from user_cons_columns cu, user_constraints au whe
1,主键约束创建索引 作为Primay Key的列是唯一的,非空的,Sql Server在创建主键约束时,自动为主键列创建一个唯一索引,并且索引列不允许为null. create table dbo.test ( id int primary key nonclustered , code int ) create table dbo.test2 ( id int primary key clustered , code int ) 查看Sql Server为主键约束创建的索引 select o