I have this query code:
IF EXISTS (
SELECT
*
FROM sys.objects
WHERE object_id =
OBJECT_ID(N'[dbo].[BAL_WMS_STAGING]')
AND type in (N'U')
)
DROP TABLE
[dbo].[BAL_WMS_STAGING]
GO
CREATE TABLE
I am trying to use this statement to query an SAP Hana Database. The beginning of the query IF EXISTS
keeps throwing an error, I assume that this means that this keyword does not exist in Hana SQL syntax. Does anyone know how to do an IF EXISTS
check in Hana, as I am unable to find any answer online.
If EXISTS is a non-standard syntax that HANA doesn't support.
As an alternative you can query the catalog and write a IF...THEN
statement in SQLScript.