I have a table Foo
with the following fields:
ID bigint not null identity(1,1),
SerializedValue nvarchar(max),
LongValue as TRY_CAST(SerializedValue as bigint)
Now I want to create an index on LongValue, so that I can easily look up on serialized values that represent numbers.
create nonclustered index IX_Foo on Foo(LongValue);
Which spits out the following error at me:
String or binary data would be truncated.
Yes, there is existing data in SerializedValue. But what, pray, can be truncated by creating an index on a computed field?