Stored procedures are units of business logic that are stored and used in a database. They can be used to add additional constraints or automatically generate additional data during database transactions. Square Bridge uses stored procedures with SAP Business One SQL Server to maintain the uniqueness of data created in SAP Business One from syncing with Square.
This topic describes how to add stored procedures to your SQL database and provides the business logic as source code that you store in your database for Square Bridge support.
The stored procedure code is intended to prevent duplicates on the
SqReferenceId for any object including:
- A/R invoices.
- A/R credit memos.
- Sales orders.
- A/R downpayment invoices.
- Incoming payments.
- Outgoing payments.
In addition, the stored procedure should prevent duplicates on
SqCustomerId for business partners. For assistance setting up a stored procedure, contact your VAR.
You need to know your SQL server and database names to complete this task.
Start Microsoft SQL Server Management Studio.
In Object Explorer, choose [SQL Server Name], Databases, [Database Name], Programmability, and Stored Procedures.
Find the dbo.SBO_SP_TransactionNotification stored procedure.
Right-click dbo.SBO_SP_TransactionNotification, and then choose Modify.
Copy all the SQL code in Square Bridge stored procedures.
In Management Studio Console, paste the SQL code at the end of dbo.SBO_SP_TransactionNotification, just before the last four lines of the file (at -- ADD YOUR CODE HERE).
Run the updated stored procedure by choosing the Execute button (next to the red exclamation mark) on the Management Studio Console toolbar.
If the stored procedures execute successfully, “Command(s) completed successfully” and “Query executed successfully” is displayed in the editor console.
If the stored procedures did not execute successfully, be sure you have created the necessary user-defined fields. Execute the procedures again after creating the user-defined fields.
Exit Microsoft SQL Server Management Studio. You do not need to save anything.