I'm trying to upload an image file to my on-premise SQL Server instance. Table schema is as follows:
CREATE TABLE [Attachment]
(
ID INT IDENTITY(1,1)
, ParentType NVARCHAR(20)
, ParentID INT
, Content VARBINARY
, CONSTRAINT PK_Attachment PRIMARY KEY (ID)
)
Using VARBINARY since the IMAGE data type will be deprecated. The tutorial I'm following is here:
https://powerapps.microsoft.com/en-us/blog/upload-files-from-powerapps-to-sql-server/
I think the "Add Picture" control has changed, because the ".Image" property is no longer available. I'm using ".Media" instead but still getting an error. Here's my OnSelect formula for the submit button:
Patch('[dbo].[Attachment]', Defaults('[dbo].[Attachment]'), {ParentType:"Label", ParentID:1, Content:AddMediaButton1.Media})'
Error Message:
The requested operation is invalid. Server Response: Microsoft SQL: String or binary data would be truncated.
What am I missing?