Skip to main content
Solved

How to write a varbinary(max) to SQL Server Spatial?

  • November 22, 2012
  • 1 reply
  • 45 views

For compatability-reasons with Geomedia I need to write an additional field of the type "varbinary(max)" to all the tables in our SQL Server Spatial database. In FME I can set the varbinary datatype, but I can't set the "max" value. I've asked around and so far it seems the only workaround is to create the field with the datatype "image" and then alter the datatype directly in SQL Server afterwards. Any ideas on how to do a better workaround?

Best answer by sigtill

Shooting in the dark here:

 

 

Can you use the SQLExecutor directly in FME to create this? For instance run a Query similar to this to create or alter the table (from http://stackoverflow.com/questions/12082961/sql-server-2008-r2-varbinary-max-size)  :

 

 

 CREATE TABLE dbo.blob(col VARBINARY(MAX)); INSERT dbo.blob(col) SELECT NULL; UPDATE dbo.blob    SET col = (SELECT BulkColumn      FROM OPENROWSET( BULK 'C:\Folder\File.docx', SINGLE_BLOB) alias   ); SELECT DATALENGTH(col) FROM dbo.blob;
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • Best Answer
  • November 22, 2012
Shooting in the dark here:

 

 

Can you use the SQLExecutor directly in FME to create this? For instance run a Query similar to this to create or alter the table (from http://stackoverflow.com/questions/12082961/sql-server-2008-r2-varbinary-max-size)  :

 

 

 CREATE TABLE dbo.blob(col VARBINARY(MAX)); INSERT dbo.blob(col) SELECT NULL; UPDATE dbo.blob    SET col = (SELECT BulkColumn      FROM OPENROWSET( BULK 'C:\Folder\File.docx', SINGLE_BLOB) alias   ); SELECT DATALENGTH(col) FROM dbo.blob;

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