How to design work period table in Sql

Hi Teams,

Accidently deleted work peroid table “dbo.workperiod” in sql.Can i create(design) new table as new.

Thanks

Not unless you know the exact schema and settings. How do you accidentally delete a critical database table? What we’re you trying to modify? I ask because we may be able to help.

I wanted to delete a single period but deleted the db…Now the app doesn’t open

You should never try and alter the db directly. Even if you succeeded in deleting a WP it’s like that would have broken something else. Can I ask why you needed to remove a WP?

Replacing the table structure will not solve your problem… Your existing transactions and inventory will be linked to all the work period records that were lost when you dropped the entire table.

Your only option would be to restore the DB from your latest backup

1 Like

Don’t need inventory and transactions but menus and account data should be there.

OK, if you don’t need the transaction then in V5 there is a DB option for delete all transactions… Run that

Then, change the DB to “MyTempDatabase” - when you do this SambaPOS will create a new SQL DB in your server called MyTempDatabase…

Take a look in SQL Management Studio and you should be able to see the table schema to re-create the structure in you main DB. Once you have done this, switch the DB back to your main one again and you should be OK.

1 Like

Ok , I am using V4 there is no option to delete transactions.Possible to delete in Studio?

There is is you install the database tools module (included in v5) but can be used in trial mode on v5.
It clears all transactional day which will include tickets, accounts etc and leave settings, entity lists, menus etc.

Ok its done…Thanks