I'm looking for a way to control the order in which User Defined Types are executed on an initial deployment to a blank database for my developers. By default, they all seem to appear in alphabetical order. The issue I have is that I have a table type of name CaseInvoices that contains a column for the type DelinquentCaseNumber. Clearly, DelinquentCaseNumber needs to be created first, but the "get latest" doesn't appear to recognize this dependency
Comments
3 comments
-
Hi @AbeAxiomatic
So, unfortunately, it's not possible to change the deployment order within SQL Source Control, the tool should however detect dependencies and script out the objects in the correct order.
Could I please ask what version of SQL Source Control you're using? -
Hi, Dan
Thanks for the quick response! I'm currently using SQL Source Control (not Change Automation) Version 7.2.4.11418. I'll paste my CREATE scripts below for context. The scenario where this comes up is in getting a new employee set up with a blank database, and using Source Control to deploy all database objects and static data.PRINT N'Creating types'GOCREATE TYPE [dbo].[CaseInvoices] AS TABLE([CaseNumber] [dbo].[DelinquentCaseNumber] NULL,[EntryDetail] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,[InvoiceAmount] [decimal] (18, 2) NULL)GO@ERROR <> 0 SET NOEXEC ONGOCREATE TYPE [dbo].[DelinquentCaseNumber] FROM int NOT NULLGO@ERROR <> 0 SET NOEXEC ONGOCREATE TYPE [dbo].[CasePayments] AS TABLE([CaseNumber] [dbo].[DelinquentCaseNumber] NULL,[PaymentAmount] [decimal] (18, 2) NULL)GO -
Hi @AbeAxiomatic
Apologies, I didn't get an email that you replied to this forum post!
I'm going to chase up from a support ticket as I'll need some more details!
Add comment
Please sign in to leave a comment.