constraints

External Article

Declarative SQL: Using UNIQUE Constraints

  • Article

In SQL, you can express the logic of what you want to accomplish without spelling out the details of how the database should do it. Nowhere is this more powerful than in constraints. In this introduction to Declarative SQL, Joe Celko demonstrates how you can write portable code that performs well and executes some complex logic, merely by creating unique constraints.

2015-12-15

6,149 reads

External Article

Set-based Constraint Violation Reporting in SQL Server

  • Article

When you're importing data into an RDBMS in bulk and an exception condition is raised because of a constraint violation, you generally need to fix the problem with the data and try again. The error won't tell you which rows are causing the violation. What if you've thousands of rows to search when it happens? There are solutions, writes William Sisson.

2014-10-16

8,821 reads

External Article

SQL Server Unique Constraints for Large Text Columns

  • Article

We are storing large text and URLs that are over 900 bytes in some of our tables and have a requirement to enforce uniqueness in those columns. But SQL Server has a limitation that index size can't be over 900 bytes. How do I enforce uniqueness in these columns and is it possible to achieve this in SQL Server 2005 and above? What are my different options to solve this problem? I heard that we can use CHECKSUM to create a hash, but is it possible to avoid collisions in the hash value as we are storing millions of rows?

2009-11-05

3,006 reads

Blogs

Migrate datetime data to datetimeoffset with AT TIME ZONE

By

I recently reviewed, worked on, and added a similar example to the DATETIMEOFFSET Microsoft...

The Comprehensive Guide to Mastering Your SQL DBA Skills

By

Database administrators (DBAs) are the backbone of data-driven organizations. If you're looking to break...

Friday Basics: Authentication vs. Authorization

By

Another security fundamentals topic is authentication versus authorization. For those who have a clear...

Read the latest Blogs

Forums

The Backup File Extension

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Backup File Extension

Ingest and Retrieve data from an ADX Cluster Using Python

By Sucharita Das

Comments posted to this topic are about the item Ingest and Retrieve data from...

The DBAccountant

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The DBAccountant

Visit the forum

Question of the Day

The Backup File Extension

I run this command in SQL Server 2022. What is the extension of the backup file?

BACKUP DATABASE HerdofTwo TO DISK = 'HerdOfTwo_20240501'

See possible answers