1. John Raghanti
  2. PowerServer
  3. Thursday, 31 October 2024 19:10 PM UTC

Hi! I'm running PB 2022 R3 Build 3391. We use Microsoft SQL Server as our database, and are in the process of converting our application to be used through PowerServer - it's not in production yet.

I ran into a weird situation and was wondering if there was a workaround or see if anyone has any advice.

I've got a table that has a datetime column (recorded_on) with a default constraint of getDate().

When the datawindow was created, the developer added recorded_on into the updateable columns. It has worked correctly in our client/server application without any issues.

Our QA team reported some issues of missing data and it led me to find that the recorded_on column was Null rather than populated. After testing, it only happened when someone was creating records through PowerServer.

SQL Server Profiler showed me that the following SQL was being run to insert data:

exec sp_executesql N'INSERT INTO [our_table] ([table_id], ..., [recorded_on], ...)
VALUES (@pp0, ..., @pp13, ...);'

Since the column was specified in the insert, it is causing the default constraint to be skipped.

We could have this issue in a lot of tables and a lot of datawindows. Is there any way to fix this at the PowerServer level or database connection properties? I really don't want to go to management and say we need to get a list of all tables and columns with default constraints and then go through thousands of datawindows to ensure that our product works the same in PowerServer.

Thanks!



There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.