--所有的用户添加的库名
select [name] from master.dbo.sysdatabases where dbid>6
--当前庫下的所有用户表名(包括系统的dtproperties)
use ldxx;
select [name] from sysobjects where xtype='U'
--当前庫下的所有视图名(包括系统的syssegments和sysconstraints)
select [name] from sysobjects where xtype='V'
--当前庫下的所有用户表名和视图名(包括系统的dtproperties,视图的syssegments和sysconstraints)
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
--当前庫下的所有视图名(包括系统的syssegments和sysconstraints)
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
--按表中字段的顺序排列显示
select column_name from information_schema.columns where table_name='pt_user'
--表中字段按字母顺序排列显示
use ldxx;
select [name] from syscolumns where id = object_id('pt_user')
select [name] from master.dbo.sysdatabases where dbid>6
--当前庫下的所有用户表名(包括系统的dtproperties)
use ldxx;
select [name] from sysobjects where xtype='U'
--当前庫下的所有视图名(包括系统的syssegments和sysconstraints)
select [name] from sysobjects where xtype='V'
--当前庫下的所有用户表名和视图名(包括系统的dtproperties,视图的syssegments和sysconstraints)
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
--当前庫下的所有视图名(包括系统的syssegments和sysconstraints)
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
--按表中字段的顺序排列显示
select column_name from information_schema.columns where table_name='pt_user'
--表中字段按字母顺序排列显示
use ldxx;
select [name] from syscolumns where id = object_id('pt_user')