Previous Topic Next topic Print topic


Post-deployment Script Requirements

Restriction: This topic applies only to Visual Studio projects that include a stored procedure program called by Java, and also includes a stored procedure definition file that specifies the DATETIME2 parameter.

Java routines cannot call a SQL CLR stored procedure that contains a TIMESTAMP parameter. Therefore, TIMESTAMP parameters in stored procedures that are called by Java routines must be changed to DATETIME2 to be compatible with Java calls. However, Microsoft does not support DATETIME2 parameter types under .NET. During compilation and deployment with Visual COBOL, DATETIME2 is changed to DATETIME. In this scenario, you must provide a post-deployment script that changes the DATETIME parameter back to DATETIME2 to ensure compatibility with Java.

The procedure required to create the post-deployment script varies depending on the project template you are using in your Visual Studio project. The following describes the procedure required for each:
SQL Server Database Project Template + SQL Server 2008 R2 or SQL Server 2012
Visual COBOL does not create a post-deployment script. You must create the script and add it to the project manually.

See To add a post-deployment script for instructions on creating the script and adding it to the project.

You must also provide the stored procedure definition and skeleton COBOL file as objects in your Visual Studio COBOL project. See To create a stored procedure definition (SPD) file for further information. Once you have defined your stored procedure, the skeleton COBOL file is saved as the COBOL wrapper program when you save your project.

To enable automatic generation of code in the post-deployment script, you must edit the SPD file to add the following code to the top of the file:
POSTDEPLOY=ScriptPath/Name NAMESPACE=DefaultNameSpace;
Where ScriptPath/Name is the full path and filename of the post-deployment script file. If the path or filename contains spaces, enclose the entire path and filename in quotes. DefaultNameSpace is the default namespace used in the project, and which is used by the generated ALTER statement in the post-deployment script file. You can see the default namespace on the Application tab of your project properties.

Once all of this is in place, any DATETIME2 parameter that you code into the SPD file automatically generates the appropriate post-deployment code in the post-deployment script file.

Previous Topic Next topic Print topic