Forum Discussion
Connecting to SAP HANA tables suing SQL query
Hi,
Can anyone help on building query how you can export data from SAP HANA db using SQL query without going into view mode and selecting columns?
Let me try to clear above question when you connect to SQL server using sql query you write (Select * from dbo.TableName) and you get the required fields and go directly to tranform,
this doesn't work with SAP HANA db, i have already read many articles, tried many combos but nothing work. Even if you say that's not possible would make me stop looking for an answer.
I am hoping to find soemone here who has/is dealing with SAP HANA as db.
Thanks.
PS: This query shows the table name and columns in the table but i am just unable to get rows form table or table columns directly using sql query:
select
"SCHEMA_NAME",
"VIEW_NAME",
"VIEW_COLUMN_NAME",
"CS_TYPE",
CURRENT_DATE "CurrentDate"
from CS_VIEW_COLUMNS
where CS_VIEW_COLUMNS.SCHEMA_NAME = '_SYS_BIC'
AND "VIEW_NAME" LIKE '%cdw.A%'
SCHEMA_NAME output of row 1 - "_SYS_BIC"
VIEW_NAME output in row 1 - "cdw.A.B.C/D" (D is table name, A-C are heirarchies under which table is present)
VIEW_COLUMN_NAME output in row 1 - "E" (E is column name here)
(A-E ref. are used to mask the names due to data policy)
7 Replies
- CoreyP
Solution Sage
I've never dealt with an SAP HANA db personally, but a quick google search has indicated you can certainly execute T-SQL queries against the SAP HANA db. It also looks like there is an out-of-the-box connector for PQ. Looks like you need to make sure you install the SAP HANA ODBC drivers for it to work.
https://learn.microsoft.com/en-us/power-query/connectors/sap-hana/overview
- sandeepsharmaFrequent Visitor
Already read those articles they are of no help. Thanks for reply.
- CoreyP
Solution Sage
What's the actual issue you're facing? The MS documentation specifically states you can execute a native SQL query while using the SAP connector.