Question

I'm trying to publish a change to a user defined table value type but the SSDT publish fails with the following error:

This deployment may encounter errors during execution because changes to [dbo].[my_tvp] are blocked by [dbo].[my_stored_proc].[@myTvp]'s dependency in the target database.

The TVP went from

CREATE TYPE [dbo].[my_tvp] as TABLE
(
    [Id]          VARCHAR (100) not null PRIMARY KEY,
    [ColorCount]  int           not null
)

to

CREATE TYPE [dbo].[my_tvp] as TABLE
(
    [Id]          VARCHAR (100) not null,
    [Id2]         VARCHAE (7)   NULL,
    [ColorCount]  int           not null,
    unique(Id, Id2)
)

I'm able to publish to a fresh local DB but not upgrade an existing one. Any idea why?

Était-ce utile?

La solution

I see now that TVPs cannot be altered, they have to be dropped and recreated, which is not supported by the SSDT publish mechanism

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top