I have notice that people usually use SQL statements for doing task which have an equivalent and easy way of doing in dexterity. while browsing through Dynamics community found this particular post. The person who posted the issue is doing the same, using SQL to delete the records from Dexterity form. The disadvantages I found with this method are.
- Extra line of code.
- Possible issue of SQL_Connect.
- Hidden SQL script errors which could only confirm only if we first compile them first on Query Analyzer and then use in our code.
- Limitation of text field length which can not be greater than 32,767.
- Two many concatenation for larger queries.
- Possibilities of error increases, dexterity syntax, SQL syntax errors, Tables and fields reference error and difficult to debug.
As compare to SQL_Execute, dexterity remove from table is best, simple and sweet.
release table table1;
‘Item Number’ of table table1=’Item Number’;
change table table1;
if err()=OKAY then
remove table table1;
GP will take care of database connectivity and getting the right record to delete from right table. I always avoid using SQL_Execute until unless it is not done by dexterity provided syntax for any kind of table operations.