Search code examples
sqlsql-serverpostgresqlplv8

Is something like PLV8 exist in Microsoft SQL Server?


Is something like PLV8 exist in Microsoft SQL Server (JavaScript procedural language add-on for Microsoft SQL Server)?


Solution

  • You can utilise the CLR integration in MS SQL Server, and write managed code (C# / VB.Net / possibly other languages) that you will be able to execute from within SQL Server.

    Having said that, the fact that such a possibility exists doesn't necessarily imply that it should be used. Very few tasks actually benefit from being implemented in managed code compared to T-SQL, such as (the list is by no means complete):

    • Computationally heavy string manipulations, including regexps (the latter has no alternative in T-SQL);
    • Communication with objects external to SQL Server (file system, various API endpoints, etc.);
    • Possibility to implement autonomous transactions.

    Before going this way, make sure your team understands performance and security implications related to this approach, as they are many. The aforementioned link gives you a good starting point.