Visual Studio SQL Server Database Project Publish Sequence

J Like MIB 71 Reputation points
2023-06-19T14:20:03.9466667+00:00

I am trying to use VS SQL Server Database Project to publish a database to upper levels.

Question: Is there a way to publish objects in sequence? For example, tables first before views, FNs before SPs, certain SPs before another SPs, etc, etc?

OR does sequence not matter?

Thank you

SQL Server Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Guoxiong 8,206 Reputation points
    2023-06-19T15:54:21.37+00:00

    If you use the SQL Server Data Tools (SSDT) in your database project, SSDT should handle the deployment order, i.e., tables before views, functions before stored procedures. If you wan to control some object deployment orders, you can use the pre- or post- deployment script. Each database project can only have one pre- or/and one post- deployment script.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.