Working with multiple SAP Business One companies?
Do you wish you could run a query in one company but pull data from another company?
Yes, it’s possible!
Let’s say you want to consolidate data or just compare info between companies — like invoices from your Mexico and US branches. You can query across companies by referencing the database name in your SQL.
? SQL Example:
SELECT T0."DocNum", T0."DocDate"
FROM OtherDatabaseName.dbo.OINV T0
? HANA Example:
SELECT T0."DocNum", T0."DocDate"
FROM "OtherDatabaseName"."OINV" T0
? But wait! You must grant permissions for this to work:
? Permissions Setup
✅ SQL Server:
- In SQL Management Studio, run:
USE [OtherDatabaseName];
CREATE USER [YourUser] FOR LOGIN [YourLogin];
EXEC sp_addrolemember N'db_datareader', N'YourUser';
- Replace [YourUser] and [YourLogin] with the account used in SAP.
✅ SAP HANA:
- Connect to the target tenant database.
- Grant access to the user from the main company:
GRANT SELECT ON SCHEMA "OtherDatabaseName" TO "YourUser";
Be sure your SAP user has access to use Cross-Database Queries.
✅ That’s it! Now you can run consolidated reports, comparison dashboards, or pull real-time data from multiple databases into one query.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article