Skip to main content
Question

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


masonb12
Contributor
Forum|alt.badge.img+12

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

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • February 21, 2023

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.


masonb12
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • February 21, 2023
daveatsafe wrote:

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!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings