0

How to change the column data type in PowerDesigner by VB script? I am trying to change the datatype globally in the model from varchar to varbinary, but I am unable to do it with the help with VB script.

Miki
  • 2,493
  • 2
  • 27
  • 39

1 Answers1

0

You should provide an example of code which does not work.

Here is an example which works, and creates a Column with data type varbinary:

option explicit
dim mdl : set mdl = activemodel
dim tbl : set tbl = mdl.tables.createnew
dim col : set col = tbl.columns.createnew
col.datatype = "varbinary"

Regardless of VBScript, if you want to change the data type of several columns, you'd better use a Domain:

option explicit
dim mdl : set mdl = activemodel
dim tbl : set tbl = mdl.tables.createnew
dim dom : set dom = mdl.domains.createnew
dim col : set col = tbl.columns.createnew
set col.domain = dom
dom.datatype = "varbinary"
pascal
  • 3,287
  • 1
  • 17
  • 35