'******************************************************************************
'* File: 检查名称长度.vbs
'* 目的: 检查表名、主键名、Ref、Index名称的长度是否小于30
'* 创建日期: 2014.05.15
'* 创建人: lixinglei
'* 执行方式:Ctrl+shift+x
'******************************************************************************
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl ' the current model
' get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model "
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model. "
Else
ProcessFolder mdl
End If
' This routine copy name into comment for each table, each column and each view
' of the current folder
Private sub ProcessFolder(folder)
Dim Tab 'running table
for each Tab in folder.tables
if len(Tab.code) > 30 then
output "Scans table: " + Tab.code + " 长度:" + Cstr(len(Tab.code))
end if
next
output " table 检查完成! "
output
'Dim Tab 'running table
for each Tab in folder.tables
if len(Tab.PrimaryKey.code) > 30 then
output "Scans Primary Key: " + Tab.PrimaryKey.code + " 长度:" + Cstr(len(Tab.PrimaryKey.code))
end if
next
output " Primary Key 检查完成! "
output
Dim ref 'running ref
for each ref in folder.References
if len(ref.code) > 30 then
output "Scans Reference: " + CStr(ref.code) + " 长度:" + Cstr(len(ref.code))
end if
' output Cstr(ref.code) +Cstr(len(ref.code))
next
output " Reference 检查完成! "
output
'Dim Tab 'running Index
for each Tab in folder.tables
Dim idx
for each idx in tab.Indexes
if len(idx.code) > 30 then
output "Scans Index: " + idx.code + " 长度:" + Cstr(len(idx.code))
end if
next
next
output " Index 检查完成! "
output
' go into the sub-packages
Dim f ' running folder
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub
本文来源:https://www.wddqw.com/doc/2cdcbf456edb6f1afe001f40.html
正在阅读:
powerdesigner 检查名称长度01-01
古诗音律01-01
八一建军节给军人的祝福短信01-01
小学生活二三事01-01
分享快乐作文500字01-01
忘记谢谢你——阮兆祥(歌词)01-01
瀑布01-01
营地生活作文01-01