SAP Business One SDK Support

Create all Stored Procedure While Installing Addon


We use so many stored procedure while developing Addon; And most of the time we create this manually in SQL while installing the Addon.

Below is a set of Command whcih can be used in a BAT file, so that the code will read the SQL query from the .sql file and execute the same in Server.

Steps to Do..
1. Create a BAT file and set the command as below with proper password and file patch

     "How to create a BAT file, Open a notepad copy the command and save the notepad with 
      extension .bat "

if not exist "C:\SAPLog" mkdir C:\SAPLog
sqlcmd -S localhost -U sa -P sql@123  -i "E:\sp_Drop.sql" -o "C:\SAPLog\Log.txt"


2. Execute the BAT file in the add-on after company connection.

Log File path in the command will give you the status of the SQL file execution. Or user can create a menu for the file to execute. And can be trigger when ever required.


No comments: