modifying table schema and related stored proc in one migration script
jregan
Posts: 3 New member
I am missing something and could use a little help.
I have 2 migration scripts, that i need to consolidate into 1 script for ease of deploying through multiple environments.
My think problem boils down to this.
I get errors of "Invalid column name 'newcolname'"
Is there any was to get these two updates together into the same script? ( while keeping one big transaction around the whole migration script, in case an error occurs?) I am successful when I keep them in 2 separate scripts, but due to our deployment system, we'd like to push out one migration script as we push them into higher environments
thanks
I have 2 migration scripts, that i need to consolidate into 1 script for ease of deploying through multiple environments.
My think problem boils down to this.
- I am adding a new column to table A
- I am also altering a view and stored procs that reference this new column in table A
I get errors of "Invalid column name 'newcolname'"
Is there any was to get these two updates together into the same script? ( while keeping one big transaction around the whole migration script, in case an error occurs?) I am successful when I keep them in 2 separate scripts, but due to our deployment system, we'd like to push out one migration script as we push them into higher environments
thanks
Comments
Redgate Software
There are some tables that have columns dropped as well. ( we redesigned some of our lookup tables, so the structure of a several tables and views has changed and some data is being moved between them)
This was the only solution that I got to work, and i was wondering if there was a better solution....
--this is wrapped up in 1 migration script--
step 1 : create a stored proc that scripts performs some of the table/view changes and moves some data between tables.
step 2: start a transaction,
call the stored proc (from step1),
continue to rest of migration script which alters views, procs
step3: commit transaction then delete the stored proc
Redgate Software
I used a migration script because when i checked in my changes, redgate determined that it couldn't do all of the changes and created a migration script. The migration script crated needed to be tweaked as it didn't capture all the changes that were needed.