Delete Schema via Javascript | Community
Skip to main content
November 20, 2025
Solved

Delete Schema via Javascript

  • November 20, 2025
  • 1 reply
  • 59 views

Hi,

 

Is there a special method to delete schemas via javascript?

 

The following generates an error:

xtk.session.Write(<schema _operation="delete" xtkschema="xtk:sourceSchema" _key="@name" id={schemaName} />)

 

The error:

11/20/2025 12:29:20 PM XFR-180000 The file '/usr/local/neolane/nl6/datakit/xtk/eng/schema/sourceSchema.xml' does not exist on the server. Unable to load the document of identifier 'xtk:sourceSchema' and type 'xtk:schema'.

 

Thanks,

Skyler

Best answer by ParthaSarathy

Hi @skylerqu2 ,

You can use SQL code activity and execute DROP TABLE customTable

or in JS, var sql = "DROP TABLE customTable"; xtk.session.executeQuery(sql);

But by both methods only tables will get deleted, but schema will still remain in the instance.

So, the best practice is instead of deleting using a script, navigate to Administration > Configuration > Data schemas and delete it and update the database structure.

 

1 reply

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
November 20, 2025

Hi @skylerqu2 ,

You can use SQL code activity and execute DROP TABLE customTable

or in JS, var sql = "DROP TABLE customTable"; xtk.session.executeQuery(sql);

But by both methods only tables will get deleted, but schema will still remain in the instance.

So, the best practice is instead of deleting using a script, navigate to Administration > Configuration > Data schemas and delete it and update the database structure.

 

 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
SkylerQu2Author
November 20, 2025

Hi @parthasarathy  thank you, yes, we are executing the DROP TABLE sql, but is there any way to remove the schema automatically?

ParthaSarathy
Community Advisor
Community Advisor
November 20, 2025

You can only manually delete from Administration > Configuration > Data schemas, thus you can also ensure there is no schema deleted by mistake and also can check if there is any relationship between other schema will get impacted. 

 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups