Microsoft Open Sources .NET 5 C# Language Extension for SQL Server – Visual Studio Magazine

Microsoft Open Sources .NET 5 C# Language Extension for SQL Server – Visual Studio Magazine

News
Microsoft has open sourced a .NET 5 C# Language Extension for SQL Server, allowing developers to work with relational data in the company’s flagship programming language.
The new tool joins similar extensions the company has open sourced over the past year or so for other languages, all taking advantage of a new kind of Language Extensions architecture, a SQL Server feature used for executing external code. While such code execution is isolated from the core engine processes, it is fully integrated with SQL Server query execution.
Microsoft says Language Extensions provides advantages such as:
After previously open sourcing tools for Java and R/Python last year, the .NET Core CSharp Language Extension is now on GitHub.
In the SQL Server Language Extensions scheme, any supported external language can be run by calling a stored procedure, with the results being returned as tabular data directly to SQL Server so it can easily use the external language from any application that can send a SQL query and handle the results. In the new tool, that’s done with a DataFrame, which stores data as a collection of columns.
“This extension is yet another example of using the developed programming language extensibility architecture which provides integration with a new type of language extension,” said Nikita Takru, program manager, Azure Data Team, in a Sept. 8 blog post. “This latest architecture allows customers to have the freedom to use existing SQL Server tables which they can pass to a C# application as a DataFrame.
“Then, they can perform operations in C#, use the rich libraries, and obtain back a result set. One of the reasons to use C# is to reuse existing customer C# code, calculations, logic, or extensive libraries that provide functionality which you cannot get in T-SQL. We encourage developers to use the .NET 5 C# Language Extension and build on it.”
Possible use case advantages include:
By studying the publicly documented Extensibility Framework API for SQL Server and the tool’s source code on the above-linked GitHub repo, Takru said community developers can continue to develop and contribute additional programming language extensions.
Other resources to help learn about the new offering and such language extensions in general include a Regex Sample available on GitHub that shows how to create a .NET Core C# program that receives two columns (ID and text) from SQL Server and a regular expression as an input parameter. The class returns two columns back to SQL Server (ID and text).
About the Author
David Ramel is an editor and writer for Converge360.

Printable Format
Microsoft is always soliciting feedback to help guide its development tooling efforts, most recently asking developers to weigh in with their requests to Santa for new debugging functionality in the form of a “debug-tastic” gift.
As we have reported before, Microsoft’s super-popular Visual Studio Code is the No. 1 code editor for multiple programming languages, and Google’s Go is on that list.
Microsoft’s C# programming language led the race to be named “programming language of the year” for 2022 by the TIOBE Index before being overtaken at the very end, but it’s expected to attain the throne this year.
What better way to learn about cutting-edge AI than creating a “copilot” assistant that can act as a mixologist, suggesting new cocktail recipes based on available ingredients?
New features and functionality boost productivity, C++ game development and .NET/C# (.NET MAUI).
Subscribe on YouTube
> More Webcasts
Problems? Questions? Feedback? E-mail us.

source


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *