Eval SQL.NET is a library that allow to evaluate dynamically C# expression directly in T-SQL. You never used Eval SQL.NET? Don’t worry, this step-by-step walkthrough will help you to understand the library.
Provide to your SQL Server all missing pieces like regular expression and dynamic arithmetic string evaluation.
Find your solutions:
- Dynamic Arithmetic Expression
- Dynamic Pivot Table
- Regular Expression
- String Interpolation
- Replace xp_cmdshell with DirectoryInfo & FileInfo
Performance & Scalability
Performance tuning is one of the most important task for a DBA. Don’t miss the chance to dramatically improve query performance by 300% for simple expression and by more than 2000% for complex code over User-Defined Function (UDF) and Table-Valued Function (TVF).
|Methods||1,000 rows||10,000 rows||100,000 rows||1,000,000 rows|
|Eval-SQL.NET||4 ms||13 ms||160 ms||1,650 ms|
|fn_split (TVF)||100 ms||625 ms||5,500 ms||55,000 ms|
Benchmark to split string with delimiters in SQL
Evaluate dynamic arithmetic/math expression in SQL
Make the impossible now possible. Evaluate C# expression in SQL to overcome limitations.
- Allow trusted users to create report field and filter
- Consume Web Service
- Replace text in template with String Interpolation
Dynamic Expression Example
Split text with delimiter
Improve performance and capability for splitting text with an easy to use split function and LINQ expression
- Split text with multiple delimiters
- Split text using a regular expression
- Include row index
Split Text Example
Use regular expression in SQL Server
Use Regex flexibility to overcome “LIKE” and “PATHINDEX” limitations.
Regular Expression Example
Replace xp_cmdshell with restrictive alternative
Avoid enabling xp_cmdshell and compromising your SQL Server and use instead a more restrictive solution.
- Impersonate Context
- Improve maintainability
- Improve readability
- Improve security
The best way to contribute is by spreading the word about the library:
- Blog it
- Comment it
- Fork it
- Star it
- Share it
- A HUGE THANKS for your help.