Skip to main content

I'm working with a table now that has a computed field.  SQL will not allow an insert into this field as it derives the value for me, so have to find a way to exclude this field from the Dynamic SQL Service's create function.  If I don't exclude it, I get an error on the process.  Anyone know of a way to do this?

 Also, I have to do a computed column because I cannot push sql functions such as getdate() for timestamp into the create function.  Is there a way to wrap data into functions on create or can you convert data within the function.  Right now I'm doing the conversions in a server event and storing in datafields.  This seems a little silly considering the power of smart object services.

 

Thanks,

Jason
 

I think you'll have to modify the Dynamic SQL Service to exclude columns which have the property IsComputed = 1 from insert/updates.


If you are uncomfortable modifying the code, but are still keen on using dynamic services (you should definitely understand the limitations), I would recommend using the Dynamic SQL Stored Procedure Service which generates off of stored procedures. For problem tables like the one you have, write stored procs to do the CRUD operations and then use that service rather than the Dynamic SQL Service. This would also resolve your getdate() question as you would code that functionality in your stored proc.


 HTH,


Reply