Tips for using constraints in SQL Server 2019 Avoid using CHECK_CONSTRAINTS hint with bulk copy program. Using this hint can significantly degrade performance of the bulk copy operation, because for each row loaded the CHECK constraints defined on the destination table will be executed. Without the CHECK_CONSTRAINTS hint, any CHECK constraints will be ignored. Consider using the NOT FOR REPLICATION...
Tag: nonclustered
Tips for using SQL Server 2017 triggers
Tips for using SQL Server 2017 triggers Try to use CHECK constraints instead of triggers whenever possible. Constraints are much more efficient than triggers and can boost performance. Constraints are also more consistent and reliable in comparison with triggers, because you can make errors when you write your own code to perform the same actions as the constraints. So, you...
Tips for using constraints in SQL Server 2017
Tips for using constraints in SQL Server 2017 Use cascading referential integrity constraints instead of triggers whenever possible. For example, if you need to make cascading deletes or updates, specify the ON DELETE or ON UPDATE clause in the REFERENCES clause of the CREATE TABLE or ALTER TABLE statement. The cascading referential integrity constraints are much more efficient than triggers...
SQL Server 2014 Transact-SQL Optimization Tips (Part 2)
SQL Server 2014 Transact-SQL Optimization Tips (Part 2) Try to restrict the queries result set by using the WHERE clause. This can results in good performance benefits, because SQL Server will return to client only particular rows, not all rows from the table(s). This can reduce network traffic and boost the overall performance of the query. Consider using the CONTAINS...
SQL Server 2014 Transact-SQL Optimization Tips (Part 2)
SQL Server 2014 Transact-SQL Optimization Tips (Part 2) Try to restrict the queries result set by using the WHERE clause. This can results in good performance benefits, because SQL Server will return to client only particular rows, not all rows from the table(s). This can reduce network traffic and boost the overall performance of the query. Consider using the CONTAINS […]
SQL Server 2014 Transact-SQL Optimization Tips (Part 1)
SQL Server 2014 Transact-SQL Optimization Tips (Part 1) Use views and stored procedures instead of heavy-duty queries. This can reduce network traffic, because your client will send to server only stored procedure or view name (perhaps with some parameters) instead of large heavy-duty queries text. This can be used to facilitate permission management also, because you can restrict user access...
SQL Server 2014 Transact-SQL Optimization Tips (Part 1)
SQL Server 2014 Transact-SQL Optimization Tips (Part 1) Use views and stored procedures instead of heavy-duty queries. This can reduce network traffic, because your client will send to server only stored procedure or view name (perhaps with some parameters) instead of large heavy-duty queries text. This can be used to facilitate permission management also, because you can restrict user access […]
Tips for using indexes in SQL Server 2012
Tips for using indexes in SQL Server 2012 Keep your indexes as narrow as possible. Because each index takes disk space try to minimize the index key’s size to avoid using superfluous disk space. This reduces the number of reads required to read the index and boost overall index performance. Check that index you tried to create does not already...