SQL Change Automation - Create Trigger Failure & TVPs
Shaggy
Posts: 16 Bronze 1
Does SCA distinguish between table & TVP objects with the same name?
The build fails when attempting to create a trigger object on a table when a table-valued-parameters exists with the same name. This error message is thrown because we have a table and TVP with the same name.
Our workaround is to change the TVP name. Is this workaround recommended?
The build fails when attempting to create a trigger object on a table when a table-valued-parameters exists with the same name. This error message is thrown because we have a table and TVP with the same name.
Our workaround is to change the TVP name. Is this workaround recommended?
2019-02-06T13:11:47.9468715Z ##[warning]The error 'The object 'dbo.Address' does not exist or is invalid for this operation.' occurred when executing the following SQL:
2019-02-06T13:11:47.9468715Z ##[warning]/****** Object: Trigger dbo.TrgAudit_Address Script Date: 11/10/2004 4:56:12 PM ******/
2019-02-06T13:11:47.9468715Z ##[warning]CREATE TRIGGER [dbo].[TrgAudit_Address] ON [dbo].[Address]
2019-02-06T13:11:47.9468715Z ##[warning]FOR UPDATE, DELETE, INSERT
2019-02-06T13:11:47.9468715Z ##[warning]AS
2019-02-06T13:11:47.9468715Z ##[warning]BEGIN
Tagged:
Answers
Interesting question! I did a few tests:
I created a table named dbo.duplicate, and a table type named duplicate. Committed, ran sequence of build and deploy via powershell, they succeeded.
Added a procedure, dbo.useduplicate, taking a parameter of the duplicate type as a TVP, and also using the type inline in the procedure in a writable way. Committed. Build and deploy still succeeding.
Added a trigger onto the dbo.duplicate table, committed. Build and deploy still succeeded.
The SQL I used is here.
So something about our scenarios is different -- if you check out the SQL I'm using, any suggestion on what changes need to be made to reproduce your setup? I may just have misunderstood what you are describing.
Thanks!
Kendra
I executed your SQL in my environment and it failed with the following message:
Version 15.117.27414.0
Running SQL Change Automation:Build v3.1.