Posts

Showing posts from August, 2019

Changing Schema in AL Development

Image
In software development, it is rare that you get it right the first time.  The rules for AL extensions are very unforgiving and if you accidentally create a field with the wrong type, you can find yourself unable to change it.  Fortunately there is a way to handle this.  By inserting a schema SchemaUpdateMode value into your launch.json you can control exactly how deploying your development app handles the data. There are three values: ForceSync: This pushes schema changes through, deleting any incompatible data. Recreate: Completely deletes your tables and data and creates them from scratch.  This is useful if you have a setup routine that creates data. Synchronize: This is the default update mode.  It allows the least flexibility but should not be used unless you know what your changing and don't have prior versions deployed already.  If you choose to use ForceSync or Recreate modes, change the SchemaUpdateMode back to synchronize once you are done...

Troubleshooting SQL Locks

Image
SQL Locking is one of the most frustrating and misunderstood issues you will encounter when dealing with SQL Server.  One good tool for getting a handle on this is SQL Profiler.  There is a blocked process event that it can monitor but it must first be enabled.  To enable SQL blocked process monitoring, use the sp_reconfigure command: sp_configure   'show advanced options ' ,  1    RECONFIGURE GO sp_configure   'blocked process threshold' ,  10 GO RECONFIGURE GO The blocked process threshold needs to be set because blocking happens quite frequently and it's up to you to determine when it becomes a problem.  This is typically going to be right around the time the application times out and the user gets an error message.  Once this is enabled, you can use the SQL Profiler tool to collect locking events. I will typically take out the SQL statement and procedure events, since these tend to bloat the file and generate a l...