Alter a Data project with this syntax.

Syntax

ALTER PROJECT { project_name | ID identifier }
[ [ PRESCRIPT | SCRIPT | POSTSCRIPT ] AS { <SQL statement> } ]
[ OPTIONS ( RUN_AS 'Cirro user', SCHEDULE 'cronSchedule', START '<begin date>', FINISH '<end date>', PROPERTIES 'JSON document' )]

Arguments

  • ‘project_name’ - user specified project name added during CREATE or ALTER PROJECT command. These are unique for all active projects, but not for deactivated projects.

  • FROM PROJECT ID id - This clause finds the specified project and copies the project table entry, and create/replace the project_map entries, with the ones from the specified project.

  • SCRIPT | PRESCRIPT | POSTSCRIPT - any scripts to execute.

  • SQL statement - Any valid SQL statement. Usually this is a BEGIN..END block;

  • SCHEDULE

    • A Quartz-style cron schedule

    • BEGIN, END : Default to ‘never”, clauses will populate the projects table and optionally create a Quartz job with the given schedule.

    • If removed, any scheduled job will be deleted

  • START - begin date

  • FINISH - end date

  • PROPERTIES - Optional storage for Data Management output.

  • RUN_AS

    • sets the run-as user.

    • This defaults to the current user if not specified.

    • If removed, the project will run as the creator.

  • OPTIONS

    • STATUS INACTIVE - permits DROP_PROJECT to function.

    • STATUS ACTIVE - sets status of project to active and prevents drop.

    • UNMAP source TO target - Remove all mappings related to this source and target and retain all other mappings

    • name - used to rename the project

Additional Information

  • An empty string or explicit NULL can be used to remove an option.

  • Both scheduled and manually executed projects log to the project_runs and run_detail tables.

  • Scheduled job information will still be found in sys.cirrojob and cirrosys.jobstatus

  • A scheduled job has one row in sys.cirrojob of “EXECUTE PROJECT project_name”

  • RUN_AS must be included as the last argument.

Examples

Remove all mappings related to this source and target and retain all other mappings

ALTER PROJECT 124 UNMAP localtest1.test1.inventory TO localtest2.test2.inventory
ALTER PROJECT ID 665 SCRIPT AS { DATACOPY ... } ;

This flags the project as inactive, hiding it in the application unless searched for.

All run logs are kept while a project is inactive, subject to the general log retention policy.

ALTER PROJECT ID 665 OPTIONS ( STATUS 'INACTIVE' ) ;

See Also