Little SQL Server Tricks: CREATE OR ALTER Views

With SQL Server 2016 SP1 came a small but helpful new statement to create views: OR ALTER. If you add this to the create script for a view, SQL Server will figure out if it should run the CREATE or the ALTER statement:

This feature is especially helpful when you incrementally develop your views. …

Read more

Little SQL Server Tricks: Disable All Triggers and Constrains of a Table

For our light-weight data synchronisation tool we need to disable all triggers and constrains on our tables until the data is consistent again. In SQL Server we can use these commands to disable everything, do our work and then reactivate the checks and triggers:

Be aware that you disable the data protection of your …

Read more

Python Friday #89: Constraints, Indexes and Default Values in SQLAlchemy ORM

The right index can boost the performance of your SQL query enormously while constrains help you to enforce the integrity of your data in the database. Let us look how SQLAlchemy can help us with both. I made my examples for SQLAlchemy ORM, but they work in Core as well. This post is part of …

Read more