Search code examples
sql-servervb.netvisual-studio-2019sql-server-data-toolssqlclr

Visual Studio 2019 Missing SQL CLR VB


In VS2019 under "Project | Add New Item | Installed | SQL Server" I have the "SLQ CLR C#" option but not the "SQL CLR VB" option. How do I get the VB option?

The SQL Server 2019 documentation has both C# and VB examples (e.g. CLR User-Defined Aggregate - Invoking Functions). I have VB.Net setup in VS2019. However, the SQL CLR VB option is not available.

Have I missed a component in the install or do I have to download something from the VS Marketplace?


Solution

  • This should have to do with the language set for the (database) project itself. Try the following steps:

    1. Go to the "Project" menu

    2. Select "<Project_Name> Properties"

    3. Go to the "SQLCLR" tab

    4. There should be a dropdown for "Language".

      The dropdown is greyed as if it cannot be selected, but you can select it and change the language to "VB"

    After making that change:

    1. Go to "Add New Item" (either via the "Project" menu or by right-clicking the project in Object Explorer)

    2. Select "SQL Server"

      "SQL CLR VB" should show instead of "SQL CLR C#".