SQL width for char extent fields

Posted by Stefan Marquardt on 30-Jul-2015 06:29

For our MS SQL replication (export) I use dbtool to set the width and then run normal EXPORT.
That seems to be the fastest way to run a single replication from ABL to SQL server.
This works fine except for extents.

dbtool:

Fld#  SQLWidth  Max Width  ERROR NAME
----  --------  ---------  ----- ----
  2:        24         24        job_id                                       
  3:      Date          0        run_date                                     
  6:       620        290        Param_data                                   
  7:        40         25        Param_typ 

Result of DataAdmin Pro/SQL, Dump as CREATE TABLE (MS SQL Server)

CREATE TABLE t32job_param (
  job_id varchar (24) null,
  run_date datetime null,
  run_time integer null,
  sbm_time_100 integer null,
  param_data##1 varchar (60) null,
  param_data##2 varchar (60) null,
  param_data##3 varchar (60) null,
  param_data##4 varchar (60) null,
  param_data##5 varchar (60) null,
  param_data##6 varchar (60) null,
  param_data##7 varchar (60) null,
  param_data##8 varchar (60) null,
  param_data##9 varchar (60) null,
  param_data##10 varchar (60) null,
  param_typ##1 varchar (2) null,
  param_typ##2 varchar (2) null,
  param_typ##3 varchar (2) null,
  param_typ##4 varchar (2) null,
  param_typ##5 varchar (2) null,
  param_typ##6 varchar (2) null,
  param_typ##7 varchar (2) null,
  param_typ##8 varchar (2) null,
  param_typ##9 varchar (2) null,
  param_typ##10 varchar (2) null,
  PROGRESS_RECID bigint null,
  PROGRESS_RECID_IDENT_ bigint identity
)
go

We use this 1:1 as ddl for the SQL database.

Now, one extent of param_data has a longer value than 60, but all others have ""
In SQL server we get an truncation error for this field (extent).

Is the only chance to set every (ext) field to the dictdb._field._width value?
This would be 620 for every extent(field).

All Replies

Posted by Garry Hall on 30-Jul-2015 21:27

I took a brief look at the dictionary code, and I think you are correct, the _field._width value determines this. However, others more versed in the MSS tools might have better information.

Posted by sgarg on 31-Jul-2015 06:40

I am assuming you are using DataServer for MSS for MSSQL Server replication.

The value that you are observing under "SQLWidth" for the extent field is the size of the entire extent column and this will get equally distributed during the migration of the data definition using DataServer for MSS Schema Migration utility. i.e. each extent field will get 62 bytes width on MSSQL Server.

This thread is closed