Question

Find a way to convert a point fgdb file with attachments and write to sqlserver

  • 17 February 2023
  • 2 replies
  • 1 view

Badge +6

Is there a way to convert an fgdb point file with attachments to sqlserver? Should the photo attachments be stored outside of sqlserver in a separate file? I can convert the point file but how to handle the associated attachments is the problem.

thanks

 


2 replies

Userlevel 2
Badge +17

Hi @masonb12​,

SQL Server allows columns of type varbinary_max, which can store your photos as binary data.

One approach would be to use an nvarchar column to store the image name and a varbinary_max column to store the binary of that file. These columns can be populated from the ATT_NAME and DATA fields of the _ATTACH table in the GDB.

When adding the GDB reader in FME, uncheck the Ignore Relationship Info button in the reader Parameters. You will need the info in the _ATTACHREL relationship table to merge the attachments onto the points before writing to SQL Server.

Badge +6

Hi @masonb12​,

SQL Server allows columns of type varbinary_max, which can store your photos as binary data.

One approach would be to use an nvarchar column to store the image name and a varbinary_max column to store the binary of that file. These columns can be populated from the ATT_NAME and DATA fields of the _ATTACH table in the GDB.

When adding the GDB reader in FME, uncheck the Ignore Relationship Info button in the reader Parameters. You will need the info in the _ATTACHREL relationship table to merge the attachments onto the points before writing to SQL Server.

Ok thanks, will give that a try!

Reply