????1.SQL Server 2000?в??????
?????????????Щ??????????????????????????????????????????Sysobjects??????????????????????????????????????????SQL???????
????Select *
????From sysobjects
????Where name like '%user%'
????2.?????????????????????и??е???????????????syscolumns??????????????????а?????user?????б??????????????SQL????????
Select *
From sysobjects s
Where Exists(
Select *
From syscolumns
Where ID = s.ID and name like '%user%'
)
????3 .SQL SERVER
?????????б?????
????select    name    from    sysobjects    where    type='U'
?????????????????????
????Select name from syscolumns Where ID=OBJECT_ID('????')
????select * from information_schema.tables
????select * from information_schema.views
????select * from information_schema.columns
????4.ACCESS
?????????б?????
????select    name    from    MSysObjects    where    type=1    and    flags=0
????MSysObjects?????????????????????????????????????????????????????????????????
????1.????????????????
--???SqlServer?б??
SELECT syscolumns.name??systypes.name??syscolumns.isnullable??
syscolumns.length
FROM syscolumns?? systypes
WHERE syscolumns.xusertype = systypes.xusertype
AND syscolumns.id = object_id('??????')
????2.?????ε????????
????--???SqlServer?б?? ????????????
declare @table_name as varchar(max)
set @table_name = '??????'
select sys.columns.name?? sys.types.name?? sys.columns.max_length?? sys.columns.is_nullable??
(select count(*) from sys.identity_columns where sys.identity_columns.object_id = sys.columns.object_id and sys.columns.column_id = sys.identity_columns.column_id) as is_identity ??
(select value from sys.extended_properties where sys.extended_properties.major_id = sys.columns.object_id and sys.extended_properties.minor_id = sys.columns.column_id) as description
from sys.columns?? sys.tables?? sys.types where sys.columns.object_id = sys.tables.object_id and sys.columns.system_type_id=sys.types.system_type_id and sys.tables.name=@table_name order by sys.columns.column_id