declare @Module nchar(2)
declare @Path nvarchar(50)
set @Path=’C:\dbstructure’
declare @str nvarchar(128)
declare @str1 nvarchar(128)
declare modules cursor
for
select
FeatureCode
from ScaFeatures
where FeatureCode in (’AM’,’CM’,’DI’,’GL’,’HR’,’MA’,’MP’,’OR’,’PA’,’PC’,’PL’,’PN’,’PR’,’SC’,’SL’,’SM’,’ST’,’SY’)
order by FeatureCode
open modules
FETCH NEXT FROM modules
INTO @Module
WHILE @@FETCH_STATUS = 0
BEGIN
declare table_names cursor
for
select rtrim(ObjectName) as TableName
from ScaDBObjects (nolock)
where upper(left(ObjectName,2))=@Module
and TypeCode=’ST’ and ObjectName not in(’ScaAttachments’,’ScaE4SEClosedTrans’)
order by ObjectName
open table_names
FETCH NEXT FROM table_names
INTO @str
WHILE @@FETCH_STATUS = 0
BEGIN
print @str
—Запись файла структуры данных конкретной таблицы
exec usr_WriteToHTMLFile @Path, @str
FETCH NEXT FROM table_names
INTO @str
end
CLOSE table_names
DEALLOCATE table_names
—Запись index.html для каждого модуля
exec [usr_WriteToPHPFileScalaTables] @Path, @Module
FETCH NEXT FROM modules
INTO @Module
end
CLOSE modules
DEALLOCATE modules
—Общий index.html для выбранной версии
exec usr_WriteToHTMLIndexFile @Path
—Системные объекты
declare table_names cursor
for
select ObjectName as TableName
from ScaDBObjects OBJ (nolock)
join (
select distinct ObjectID from ScaColumns COL (nolock)
) COL on OBJ.ObjectID=COL.ObjectID
where (TypeCode<>’ST’ and TypeCode<>’MT’) or ObjectName in(’ScaAttachments’,’ScaE4SEClosedTrans’)
order by ObjectName
open table_names
FETCH NEXT FROM table_names
INTO @str
WHILE @@FETCH_STATUS = 0
BEGIN
print @str
—Запись файла структуры данных конкретной таблицы
exec usr_WriteToHTMLFileSystemObject @Path, @str
FETCH NEXT FROM table_names
INTO @str
end
CLOSE table_names
DEALLOCATE table_names
—Запись index.html для модуля
exec usr_WriteToHTMLFileScalaTablesSystemObjects @Path, ’00’ |