Set Up the SQLServerSP Database Project

Takes you through the process of creating a Visual COBOL database project to use as you complete the remainder of these tutorials.

Create the SQLServerSP project

The SQL CLR Integration feature in Visual COBOL uses a project template named SQL Server Database Project, which is configured specifically for SQL CLR. Here, you create a Visual Studio project based on this template.

  1. In Visual Studio, click File > New > Project.
  2. On the Create a new project dialog box, scroll down the list, and select SQL Server Database Project, and then click Next.
    Note: If more than one SQL Server Database Project templates are on the list, select the template for the COBOL language and the Windows platform.
  3. Complete the fields as follows:
    Project name SQLServerSP
    Location c:\tutorials\SQL
    Framework Choose the appropriate .NET Framework version from the drop-down list.
    Note: Must be version 4.5 or later.
  4. Check Place solution and project in the same directory.
  5. Click Create.

Set project properties

  1. From the Solution Explorer, double-click Properties under your SQLServerSP COBOL project.
  2. On the Application tab, set the Output type to Console.
  3. On the SQL tab, select OpenESQL from the ESQL Preprocessor drop-down list.
  4. Click Add.
  5. On the Available Directives list, click DBMAN; then click OK.
  6. Repeat steps 3 and 4, but this time add the BEHAVIOR directive.
    Note: The default value for both DBMAN (ADO) and BEHAVIOR (OPTIMIZE) are correct, so you don't need to make any value changes.
  7. Click Save Save.
  8. From the Solution Explorer, open the project properties for the .Publish project.
  9. On the Project Settings tab, set the Target Platform to the version of Microsoft SQL Server that you are using.
  10. On the Debug tab, click the Edit button associated with Target Connection String.
  11. In the Server Name field, type . (dot) to indicate the local SQL Server instance.
  12. From the Database name drop-down list, select SQLCLR_Test; then click OK.
  13. Click Save Save, and then close both Properties windows.