Does anyone know whether it is possible to create a UDDT that is something like this:
CREATE TYPE dbo.TID FROM int NOT NULL IDENTITY(1,1)
Everything before IDENTITY(1,1) is legal and will generate a new UDDT. However, I need to set IDENTITY automatically during the definition of UDDT and usage during table definition. Sometimes, in case we decide to change from INT IDENTITY(#,#) to UNIQUEIDENTIFIER I would like to change it in one place only. I don’t find it very interesting going through the tables and modifying from one type to another especially because there will be a lot of tables.
Regards,
Huske
This is not possible. Have a look at CREATE TYPE. Identity is not part of the data type. It is part of a column definition.