SQL SERVER2000 ???Щ????
???????????? ???????[ 2014/3/19 10:05:54 ] ????????SQL ??
????3.????????????????
????--???????????????
????select [name] from syscolumns where
????id=object_id(N'??????') and COLUMNPROPERTY(id??name??'IsIdentity')=1
????4.???????????
????--?????????????
????exec sp_helpconstraint '??????' ;
????5.?????????????
????--????????
exec sp_helpconstraint '??????' ;
SELECT ???? = CASE a.colorder WHEN 1 THEN c.name ELSE '' END??
?? = a.colorder??
?????= a.name??
??? = CASE COLUMNPROPERTY(a.id??a.name??'IsIdentity') WHEN 1 THEN '√' ELSE '' END??
???? = CASE
WHEN EXISTS ( SELECT * FROM sysobjects WHERE xtype='PK'
AND name IN (SELECT [name] FROM sysindexes WHERE id=a.id
AND indid IN (SELECT indid FROM sysindexkeys WHERE id=a.id
AND colid IN (SELECT colid FROM syscolumns WHERE id=a.id
AND name=a.name)))) THEN '√' ELSE '' END??
????= b.name??
?????= a.length??
???? = COLUMNPROPERTY(a.id??a.name??'Precision')??
С?? = CASE ISNULL(COLUMNPROPERTY(a.id??a.name??'Scale')??0) WHEN 0 THEN '' ELSE CAST(COLUMNPROPERTY(a.id??a.name??'Scale') AS VARCHAR) END??
?????= CASE a.isnullable WHEN 1 THEN '√' ELSE '' END??
????= ISNULL(d.[text]??'')??
??? = ISNULL(e.[value]??'')
FROM syscolumns a
LEFT JOIN systypes b ON a.xtype=b.xusertype
INNER JOIN sysobjects c ON a.id=c.id AND c.xtype='U' AND c.name<>'dtproperties'
LEFT JOIN syscomments d ON a.cdefault=d.id
LEFT JOIN sys.extended_properties e ON a.id=e.class AND a.colid=e.minor_id
ORDER BY c.name?? a.colorder
????6.??????е????
????--??????????е????п???
????select * from master..sysdatabases
????7.??????????????п?????б?
????--??????????????п?????б???
use master
declare @db_name varchar(100)
declare @sql varchar(200)
declare cur_tables cursor
for
select name from sysdatabases /*where name like 'by_%'*/
open cur_tables
fetch next from cur_tables into @db_name
while @@fetch_status = 0
begin
--set @db_name = @db_name + '.dbo.sysobjects'
print @db_name
set @sql = 'select * from ' + @db_name + '.dbo.sysobjects where xtype =''U'''
exec (@sql)
fetch next from cur_tables into @db_name
end
close cur_tables
deallocate cur_tables
go
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11