Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to delete a Table ?

Manasa23
Tera Contributor

HI,

I was trying to create a  Archival rule for  alm_Hardware table, by mistake I have selected the cmdb_ci_ hardware table and saved the record.

I can see the tables were  created with ar_cmdb_ci_ in sys_db_object_list. 
i have tried to delete the tables created, but I could not able to see the  Delete  option. i have  Provided screenshot below, Can someone help me on this ??

find_real_file.png



find_real_file.png


Thanks,
M

1 ACCEPTED SOLUTION

Shakeel Shaik
Giga Sage
Giga Sage

Hi @Manasa 

 

Run this on Background and check whether its getting correct Table name or not.

Note: replace your sys_id of the table.

var grT= new GlideRecord('sys_db_object');
grT.addEncodedQuery('sys_id=e8f0c98b6d2620100acb70b35343309d');
grT.query(); 
if(grT.next()) { 
  gs.print('Table Name = ' + grT.label);

}

 

If its showing correct sys_id, then run this below script on Background.

var grT= new GlideRecord('sys_db_object');
grT.addEncodedQuery('sys_id=e8f0c98b6d2620100acb70b35343309d'); //Replace your table Sys_id
grT.query(); 
if(grT.next()) { 
  gs.print('Table Name = ' + grT.label);

 grT.autoSysFields(false);
 grT.setWorkflow(false);
  grT.deleteRecord(); 

}

 

 

If my response is helpful, then Please mark as Correct Answer/Helpful.

Please check and let us know.

Thanks 🙂

Shakeel Shaik.

 

 

Thanks,
Shakeel Shaik 🙂

View solution in original post

3 REPLIES 3

Shakeel Shaik
Giga Sage
Giga Sage

Hi manasa,

 

Once try to delete it from List view only.

 

 

If my response is helpful, then Please mark as Correct Answer/Helpful.

Please check and let us know.

Thanks 🙂

Shakeel Shaik.

 

 

Thanks,
Shakeel Shaik 🙂

Shakeel Shaik
Giga Sage
Giga Sage

Hi @Manasa 

 

Run this on Background and check whether its getting correct Table name or not.

Note: replace your sys_id of the table.

var grT= new GlideRecord('sys_db_object');
grT.addEncodedQuery('sys_id=e8f0c98b6d2620100acb70b35343309d');
grT.query(); 
if(grT.next()) { 
  gs.print('Table Name = ' + grT.label);

}

 

If its showing correct sys_id, then run this below script on Background.

var grT= new GlideRecord('sys_db_object');
grT.addEncodedQuery('sys_id=e8f0c98b6d2620100acb70b35343309d'); //Replace your table Sys_id
grT.query(); 
if(grT.next()) { 
  gs.print('Table Name = ' + grT.label);

 grT.autoSysFields(false);
 grT.setWorkflow(false);
  grT.deleteRecord(); 

}

 

 

If my response is helpful, then Please mark as Correct Answer/Helpful.

Please check and let us know.

Thanks 🙂

Shakeel Shaik.

 

 

Thanks,
Shakeel Shaik 🙂

Hi @Manasa 

 

while deleting this, be careful, and check properly.

 

Thanks,
Shakeel Shaik 🙂