Tag: foreign key

Pro Members SQL Server Standard Members

Tips for using constraints in SQL Server 2019

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...

This content is for Pro, Pro Member, Pro Member Annual - Fall Sale, Pro Member Monthly - Fall Sale, Standard, Standard Member, Standard Member Annual - Fall Sale, and Standard Member Monthly - Fall Sale members only.
Log In Register
Pro Members SQL Server Standard Members

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...

This content is for Pro, Pro Member, Pro Member Annual - Fall Sale, Pro Member Monthly - Fall Sale, Standard, Standard Member, Standard Member Annual - Fall Sale, and Standard Member Monthly - Fall Sale members only.
Log In Register
Pro Members SQL Server Standard Members

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...

This content is for Pro, Pro Member, Pro Member Annual - Fall Sale, Pro Member Monthly - Fall Sale, Standard, Standard Member, Standard Member Annual - Fall Sale, and Standard Member Monthly - Fall Sale members only.
Log In Register
SQL Server

Tips for using constraints in SQL Server 2016

Tips for using constraints in SQL Server 2016 Try to create a single column constraint. The more columns the constraint will have, the slowly it will work and the more stored space it will require. Use default constraints instead of DEFAULT objects. DEFAULT object are provided for backward compatibility and has been replaced by default definitions (default constraints) created using […]

SQL Server

Tips for using SQL Server 2016 triggers

Tips for using SQL Server 2016 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 using triggers on memory-optimized tables. SQL Server 2016 introduces supporting triggers on […]

Pro Members SQL Server Standard Members

Tips for using constraints in SQL Server 2014

Tips for using constraints in SQL Server 2014 Use CHECK constraints instead of rules. Rules are provided for backward compatibility and have been replaced by CHECK constraints. Constraints are much more efficient than rules and can boost performance. Rules have some restrictions. For example, only one rule can be applied to a column, but multiple CHECK constraints can be applied....

This content is for Pro, Pro Member, Pro Member Annual - Fall Sale, Pro Member Monthly - Fall Sale, Standard, Standard Member, Standard Member Annual - Fall Sale, and Standard Member Monthly - Fall Sale members only.
Log In Register
Pro Members SQL Server Standard Members

Tips for using SQL Server 2012 triggers

Tips for using SQL Server 2012 triggers Microsoft SQL Server 2012 introduces many new useful stored procedures, functions and operators. Some actions you can perform without these new features, but usually using them provides more easy and effective way to accomplish the same goal. In this article, you can find some tips to use triggers in SQL Server 2012. Try...

This content is for Pro, Pro Member, Pro Member Annual - Fall Sale, Pro Member Monthly - Fall Sale, Standard, Standard Member, Standard Member Annual - Fall Sale, and Standard Member Monthly - Fall Sale members only.
Log In Register