I need to drop a table in SQL Database using Azure Databricks (PySpark).
I am required to not use anything outside PySpark to achieve this. Can this be done to using DataFrameWriter. Below code (internally I believe) first deletes the table and then creates a new table with the same name and then writes the dataframe data into the table.
MyDataFrame.write.format("jdbc").option("url", "jdbc:sqlserver://<SQLServerHost>.windows.net:1433").option("database", 'MyDBName').option("dbtable", 'MyTableName').option("user", "MyUsername").option("password", "MyPassword").mode('overwrite').save()
I want to simply delete the table completely. Is there a code to do the same?
regards, Sree