Skip to main content
Nintex Community Menu Bar

How to truncate data in K2 SmartObjects

  • October 17, 2013
  • 7 replies
  • 32 views

Forum|alt.badge.img+3

Hi Guys,


Our K2 SmartForms solution UAT will finish soon and now preparing to cleanup the test data but when i tried to delete the data in one of the smartobjects the pirmary key does not reset to 0 or 1.


Is there way to cleanup the test data in smartobjects and reset the primary keys, just like a truncate in SQL or perhaps how to execute the truncate t-sql to cleanup the smartobjects in K2 SQL database.


Please advise.


Thanks


Rupert


 


 


 


 


 

7 replies

Forum|alt.badge.img+5
  • Nintex Partner
  • October 18, 2013

Hi Rupert,


If your SmartObject is using SQL Server Svc Obj, you should be able to truncate the SQL table as per your suggestion.


If you are using SmartBox, just delete and re-deploy the SmartObject (from the designers) will achieve the same effect as well.


 


JK.


Forum|alt.badge.img+3
  • Author
  • October 18, 2013

Hi JK,


Thanks for your reply. Actually these smartobjects was create using SmartBox if i going to delete and redeploy,  will it affect the views attached to these smartobjects?


Also, i just noticed that these smartobjects are in K2SmartBox database, i'm wondering if i can just execute the truncate on these tables? I supposed i should test it, this will be much quicker if this will work unless K2 doesn't support modifying the actual tables in the K2Smartbox database.


Thanks


 


Forum|alt.badge.img+5
  • Nintex Partner
  • October 18, 2013

Hi Rupert,


You're welcomed.


As long as you re-deploy the SmartObjects from your Designer (sodx file), the SmartObjects will retain the same GUID and everything will be resume as per normal. Do make a backup of your K2 database(s), just in case =)


Regarding running of the truncate table query directly on the smartbox tables, you may like to check with the K2 Support first.


 


JK


Forum|alt.badge.img+6
  • Nintex Employee
  • October 21, 2013

why don't you use 'Delete' method to clear all the data. It is possible to truncate the data directly from the SQL management studio. It will not affect the smartobject or views. However direct database modification is unsupported.


Forum|alt.badge.img+3
  • Author
  • October 21, 2013

Thanks for our reply. I think i mentioned that the delete method is not option for me as i do not want to retain the identity seed.


The options  i have is to redeploy the smartobjects or truncate the tables in SmartBox database via SSMS. Base on my initial testing the truncate works well.


 


 


 


 


 


Forum|alt.badge.img+4
  • August 10, 2017

@NPS

Can you tell me table names for deletion?

 

Regards,

Asad Naeem


Forum|alt.badge.img+18
  • August 10, 2017

The SQL table will usually take on the SmartBox SmartObject name Specified.  


So if a SmartBox SmartObject with name 'Employees' was created; the table in the K2 database would be [dbo].[Employees].


Perhaps doing a select against this table and executing the SmartObject > List method may be a good way to confirm if it is the same entity base on the data returned.