Hello all,
We try to automate the backup/restore procedure for our
LIVE-to-TEST procedure.
We are able to backup/restore everything via SSIS.
Now the question remains whether we can automatically:
- drop a company within the restored database
- rename a company within the restored database
Can this be done via a SQL-script (or another, automated way)?
Thanks,
Jan
Comments
I will suggest to experimenting by doing it in C/AL. Simply rename the Company by code - I guess it will work.
If it doesn't work to delete a Company record, you simply need to delete all TableData records for the company in the object table. I guess it will work.
To automate it, you could either user ExpandIT Launch Utillity, or NAV2009 WebServer, or maybe a solution with the NAS. It depends on the enviroment you got.
Peter
I could try it out on one of our development databases. I am not a specialist in C/AL. Just an 'advanced' user...
Could you please give an example or a good reference where I can start reading?
The setup is NAV2009 (no rtc) with a NAS. Not sure however how this works exactly.
@bbrown: I just want to avoid doing the same thing 4 times, when we do a 'live to develop'-restore, deleting companies from the restored 'live' database and renaming the remaining company to a new one. If I could just launch a job...
Kind regards,
Jan
Any C/AL developer will be able to do it the actual coding in a few minutes, the problem is more to get it automated...
The code could be something like this: (NOT TESTED AT ALL - NOT EVEN TESTED FOR COMPILATION ERRORS ! USE AT OWN RISK !!!!)
Global: Company, Record, Company
// To delete a company...
Company.GET('Some Company Name');
Company.DELETE(TRUE);
// To rename a company...
Company.GET('Old Company Name');
Company.RENAME('New Company Name');
Peter