I do have a table scenario in SQL Server 2012 that allows me to concat a column from its properties "computed column specification" especially when creating a new record where my table has the following columns design format
[VIndex] [int] IDENTITY(1,1) NOT NULL
[VISTORID] AS (concat('PD', str([VIndex], len([VIndex]), (0)))) PERSISTED NOT NULL
In which case when the Vindex
auto increments, the vistorId
column will pick that information and add characters to it to create another unique id
For example
VIndex VISTORID
1 PD0001
2 PD0002
3 PD0003
4 PD0004
The problem am having is in SQL Server 2008, under column properties the "computed column specification" does not allow or recognize concat
. I have completely run out of ideas, when I script this database to SQL Server 2008, it won't accept so any table having this property is dropped.
How do I solve this problem?