Set Up the SQLServerSP Database Project

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

Create the SQLServerSP project

The SQL CLR Integration feature in Enterprise Developer 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. In the New Project dialog box, expand Installed > COBOL.
  3. Click the Database category.
  4. In the center pane, select SQL Server Database Project.
  5. Complete the fields as follows:
    Name SQLServerSP
    Location c:\tutorials\SQL
    Solution Name SQLServerSP
    Framework Choose the appropriate .NET Framework version from the drop-down list.
    Note: Must be version 4.5 or later.
  6. Uncheck Create directory for solution.
  7. Click OK.

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.