Some tips for using SQL Server 2019 triggers Try to minimize the number of rows affected in a trigger. The more number of rows affected in a trigger, the more time a trigger takes to run. So, try to reduce the number of rows affected in a trigger. Consider disabling trigger’s recursion. Triggers are said to be recursive when a...
Tag: CLR
Troubleshooting SQL Server 2017 CLR Problems
Troubleshooting SQL Server 2017 CLR Problems If you have problems with SQL Server 2017 Common Language Runtime (CLR) objects, review this troubleshooting checklist to find potential solutions. 1. You may receive error 701 when you use a CLR table-valued function (TVF) together with the CROSS APPLY operator in a query. The error 701 indicates that there is insufficient system memory...
Tips for designing SQL Server 2017 tables (Part 1)
Tips for designing SQL Server 2017 tables (Part 1) Avoid using CLR user-defined data types. SQL Server 2017 supports the CLR user-defined data types. These data types allow implement database data types in any of the languages supported by the .NET Framework CLR. Because using these data types usually provides worse performance than internal SQL Server data types, and you...
Some tips for using ASP.NET with SQL Server 2017
Some tips for using ASP.NET with SQL Server 2017 If you use ADO to access SQL Server data in your ASP.NET, always create a Connection object explicitly, not implicitly. This can reduce the server overhead and simplify the controlling of a connection. Set the MultipleActiveResultSets (MARS) option in the SQL Server connection string. This option makes it possible to execute...
Tips for using stored procedures in SQL Server 2017
Tips for using stored procedures in SQL Server 2017 Consider using natively compiled stored procedures. Natively compiled stored procedures are Transact-SQL stored procedures compiled to native code. These stored procedures allow for efficient execution of the queries and business logic in the stored procedure. The difference between interpreted (disk-based) stored procedures and natively compiled stored procedures is that an interpreted...
Tips for using User-Defined Functions in SQL Server 2017
Tips for using User-Defined Functions in SQL Server 2017 Consider using user-defined table type as a parameter for user-defined function. SQL Server 2017 supports a user-defined table type that supports representing table structures for use as parameters in user-defined function. Using UDF type can simplify user-defined function’s programming and may increase UDF performance. Use TRY-CATCH logic to trap and handle...
Troubleshooting SQL Server 2016 CLR Problems
Troubleshooting SQL Server 2016 CLR Problems If you have problems with SQL Server 2016 Common Language Runtime (CLR) objects, review this troubleshooting checklist to find potential solutions. 1. Install the latest SQL Server 2016 service pack. Because many SQL Server 2016 CLR bugs were fixed in SQL Server service packs, you should install the latest SQL Server service pack. At...
Tips for using stored procedures in SQL Server 2016
Tips for using stored procedures in SQL Server 2016 Try to avoid using temporary tables and DDL (Data Definition Language) statements inside your stored procedure. Using temporary tables or DDL statements inside stored procedure reduces the chance to reuse the execution plan. Consider using user-defined table type as a parameter for the stored procedures. SQL Server 2016 supports a user-defined […]
Troubleshooting SQL Server 2014 CLR Problems
Troubleshooting SQL Server 2014 CLR Problems If you have problems with SQL Server 2014 Common Language Runtime (CLR) objects, review this troubleshooting checklist to find potential solutions. 1. Install the latest SQL Server 2014 service pack. Because many SQL Server 2014 CLR bugs were fixed in SQL Server service packs, you should install the latest SQL Server service pack. At […]
User-defined functions (UDFs) – Part-2
User-defined functions (UDFs) – Part-2 Author: Basit A. Farooq Editor’s Note: In this second of the two part article series, you’ll about creating and using in-line table functions, and multi-statement table functions. You used CREATE FUNCTION, ALTER FUNCTION, DROP FUNCTION, and SQL Server Management Studio to create and manage functions. You learned about a related object, CLR aggregates. Creating a […]