How to delete a view? Getting message "Table name xxxx already exists"

jimmillet
Mega Guru

I deleted a view today and I need too recreate it, but when I try to create the view I get a message saying that "table name xxxx already exists" (where xxx is the view table name). I can not find this view in the list view, or in the dictionary; but servicenow thinks it exists. I am at Kingston version. What needs to be cleaned out to allow a new view with the same name to be created?

6 REPLIES 6

Mike Bahr
Giga Contributor
Screenshot would be helpful. Was it a database view for a report that’s trying to be viewed from the reporting engine?

Chris118
Kilo Contributor

I contacted ServiceNow support about this, and it's a known problem with database table and view caching - PRB1330793. At the time of posting the dev team haven't provided a timeframe for a fix, but there is a workaround:

Run the following command in a script, replacing table_name with the name of the database view: 

GlideTableManager.invalidateTable('table_name');


Then execute the script. 

This should remove the entry from the table cache and allow you to recreate the database view.