I'm using SSDT and MS SQL Server 2012.
And I need to handle next cases in one deployment script:
--1
CREATE TABLE Table1 (Col1 INT)
--2
INSERT INTO Table1(Col1)
SELECT SomeCol FROM SomeTable
--3
ALTER TABLE dbo.SomeTable DROP COLUMN SomeCol
--4
INSERT INTO AnotherTable(AnotherCol)
VALUES(1)
What can I see now in my deployment script:
--Pre-deployment part
--some insert. Will fail because it select/insert from/to not created objects
--Deployment part
CREATE TABLE Table1 (Col1 INT)
GO
ALTER TABLE dbo.SomeTable DROP COLUMN SomeCol
GO
--Post-deployment part
--some insert. Will fail because it select/insert from/to not created objects
How do I need to configure post/pre-deployment scripts? Is it possible to do it in SSDT automatically during deployment?
Appreciate for any proposals.