computed-column

Check for arithmetic overflows in computed columns?

In our application we're going to be allowing users to type in arithmetic expressions (+ - * /) using other database columns for numbers, which would then be parsed by the application and written into the database as a computed column. However there are problems that arise with allowing users to create expressions that could cause excep...

SQL Server: One large persisted computed column for Fulltext Indexing

It appears to me as the easiest, most straightforward solution, but please correct me if I'm wrong. Instead of having a fulltext index on all individual columns of a table, isn't it better to just generate one single wide computed column and run the fulltext index against that only? It appears to me that it gets rid of all the issues o...

SQL Server String Concatenation with Null

I am creating a computed column across fields of which some are potentially null. The problem is that if any of those fields is null, the entire computed column will be null. I understand from the Microsoft documentation that this is expected and can be turned off via the setting SET CONCAT_NULL_YIELDS_NULL. However, there I don't want ...

SQL Server: Computed Expression error

Here's a table with a computed column in SQL Server 2005: CREATE TABLE footable AS [identifier] nvarchar(255) NOT NULL, [result] AS CASE WHEN [identifier] like '%\[%]' escape '\' THEN LEFT( [identifier], CHARINDEX('[',[identifier]) - 1 ) END Here's what I'm expecting: identifier result ======================...