Skip to main content
Nintex Community Menu Bar

How to truncate data in K2 SmartObjects

  • Oct 17, 2013 10:56 PM UTC
  • 7 replies
  • 45 views
  • Translate All

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
  • Oct 18, 2013 1:33 AM UTC

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.

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 18, 2013 2:33 AM UTC

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


 

Translate

Forum|alt.badge.img+5
  • Nintex Partner
  • Oct 18, 2013 7:47 AM UTC

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

Translate

Forum|alt.badge.img+6
  • Nintex Employee
  • Oct 21, 2013 8:38 AM UTC

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.

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 21, 2013 10:11 PM UTC

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.


 


 


 


 


 

Translate

Forum|alt.badge.img+4

@NPS

Can you tell me table names for deletion?

 

Regards,

Asad Naeem

Translate

Forum|alt.badge.img+18
  • Aug 10, 2017 10:16 PM UTC

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.

Translate