Create all Stored Procedure While Installing Addon in SAP B1 SDK

 

Create all Stored Procedure While Installing Addon


While we work to develop addon, We use so many stored procedures while developing Addon, And most of the time we create this manually in SQL while installing the Addon.

Below is a set of commands which 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 the Server.

Steps to Do.
1. Create a BAT file and set the command as below with the 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 the 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 triggered whenever required.