Question

Mirror/ copy tables Microsoft SQL Server

  • 10 July 2024
  • 1 reply
  • 20 views

Badge +8

I have a Microsoft SQL Server database and need to mirror/copy some tablez to another Microsoft SQL Server.
For most attributes it is working, but not for numeric(width, precision) values it is not. The numbers after the decimal do not show in the new database. This might has to do with the decimal / language setting; I am not sure what the problem is. 

I read about the use of 'native_data_type'
https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Form/Workbench/Deriving-Destination-Schema-from-Schema-Feature.htm

'
To instruct the dynamic writer to apply the native_data_type to the schema feature, instead of the fme_data_type, specify attribute fme_format_short_name and set the value to the Format Type Identifier ("short name") of the format. For example, fme_format_short_name = “GEODATABASE_FILE”.
'

But do not know how to implement this. Where do I need to put this 'fme_format_short_name'?

Hope someone can provide some insights.

Thanks
Stefan


1 reply

Userlevel 2
Badge +25

Hi Stefanh.

I assume you’re using FME for this ? ;-)

Numeric field types often store the numbers internally as strings, and so the locale setting, especially about thousands/decimal characters, become very important. Optimally they should be the same in source and destination, but that’s not always possible to enforce.

You might want to cast the number values into proper floating point values before attempting to write them to the destination database.

In 2024 you can control the types better than before in FME. E.g. you can multiply the number by one in AttributeManager, which should yield real types. Otherwise you can use PythonCaller to cast the values.

Cheers.

Reply