2024-07-12
595 reads
2024-07-12
595 reads
A column level check constraint may be used to prevent insertion of data containing characters within a specific ASCII range.
2016-12-12 (first published: 2016-11-30)
2,268 reads
Script finds char types columns defined to allow NULL values but have non NULL values and generates the ALTER statements for the changes.
2016-02-22 (first published: 2016-02-08)
1,011 reads
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
2015-11-18 (first published: 2015-10-29)
936 reads
In which Phil Factor illustrates in TSQL how it is possible to use foreign key constraints to enforce data rules, and illustrates some surprising consequences of using cascading.
2015-03-30
3,045 reads
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
The database developer can, of course, throw all errors back to the application developer to deal with, but this is neither kind nor necessary. How errors are dealt with is dependent on the application, but the process itself isn't entirely obvious.
2012-07-10
3,666 reads
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
I am modifying a table and I need to add a column that must be defined as being unique. I see that SQL Server allows you to define a UNIQUE constraint on a column but I also see that you can create a unique index on a column. Which one should I use?
2008-09-05
8,319 reads
By Steve Jones
I published an article today on the Data API Builder, which is a way...
By Steve Jones
dolonia – n. a state of unease prompted by people who seem to like...
By James Serra
Microsoft Fabric is rapidly gaining popularity as a unified data platform, leveraging OneLake as...
Hi Gents, Silly question, but it's been a long time since I've done this....
Hi everyone I have a query that is taking a real long time. It...
Comments posted to this topic are about the item The New Log File
I have a detached database from SQL Server 2019, called TDE_Primer. This database had a 100MB data file and a 73MB log file. The log file was lost, so I need to run this code:
USE [master] GO CREATE DATABASE [TDE_Primer] ON ( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\TDE_Primer.mdf' ) FOR ATTACH_REBUILD_LOG GOHow big is the new log file? See possible answers