Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Delete objects Empty Delete objects

Tue 31 Mar 2020 - 8:40
We're replacing a couple of key areas in our main matter type and this will result in a lot of screens, datalists and searchlists becoming redundant. As we have Dev, Test, Training and Live it would be good to clean up these databases via SQL and remove all these objects instead of doing it in the front end.
Using SQL profiler I was able to get the following SQL that shows what gets run when a searchlist and datalist get erased:
exec sp_executesql N'delete from DBCodeLookup where cdcode = @Code and cdtype = ''OMSSEARCH'';delete from DBReport where rptCode = @Code;delete from DBSearchListConfig where schCode = @Code',N'@Code nvarchar(15)',@Code=N'UDCHQ'



exec sp_executesql N'delete from DBCodeLookup where cdcode = @Code and cdtype = ''ENQDATALIST'';delete from dbEnquiryDataList where enqTable = @Code',N'@Code nvarchar(15)',@Code=N'UDDSCHEQREC'


Would running the SQL be all we need to do, and is there anything else we need to be aware of?
Also there is no delete function for screens, so I was wondering if it is simply just a case of erasing from the following, or is there anything else we need to consider? delete from dbEnquiry
delete from dbEnquiryPage delete from dbEnquiryQuestion
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Delete objects Empty Re: Delete objects

Tue 31 Mar 2020 - 8:40
I noticed that the dynamic SQL to delete does not delete the Scripts as well, which makes sense because they could be shared. I've had a look in the front end (SDK, System Scripts, Screen Scripts) and I can see how the scripts get erased via the delete button.


exec sp_executesql N'delete from dbScript where scrCode = @Code',N'@Code nvarchar(15)',@Code=N''


This admin searchlist only shows the scripts for the Enquiry forms and not the searchlists (I can't find a separate searchlist for searchlist scripts), is there a reason for this, and can searchlist scripts be deleted in the same way as the enquiry form scripts?
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Delete objects Empty Re: Delete objects

Tue 31 Mar 2020 - 8:41
I'm not aware of a reason it's not included. You can add a new admin kit icon. Take a look in dbAdminMenu

select * from dbAdminMenu where admnuSearchListCode like 'SC|%' Add a new row for SC|SEARCHLIST copying the format of the existing
You can find the codes for the other script types if you want to add additional ones with: select * from dbScriptType

avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Delete objects Empty Re: Delete objects

Tue 31 Mar 2020 - 8:41
With regards to the deleting of Enquiry Forms, is it simply a case of deleting from the Enquiry, Page, Question and Script tables?
Sponsored content

Delete objects Empty Re: Delete objects

Back to top
Permissions in this forum:
You cannot reply to topics in this forum