» Database Diff Script without table drops
Database Diff Script without table drops
|January 16, 2014
Posted by forumadmin
I need to move my teams database changes from our development environment to our test environment.
I know that Visual Studio can diff two databases and output a script. But for tables that we have added columns it is dropping the table and re-inserting in with the new columns.
It tries to keep the data, but it is not going to work. It will cause FK issues, and when I try to move this to production, I will lose all the statistics on the table.
Is there a way to get it to script the table with an alter script? (So that it alters the table to add the new column?)
More Related Questions
- How to fix Visual Studios error "This server version is not supported…" for SQL Server 2012 I recently installed Visual Studio 2010 and SQL Server 2012 on a Windows Server 2008 R2 machine - (including all updates/Service Packs).
When attempting to work on a SQL Server database […]
- SQL Server 2012 column identity increment jumping from 6 to 1000+ on 7th entry I have a strange scenario in which the auto identity int column in my SQL Server 2012 database is not incrementing properly.
Say I have a table which uses an int auto identity as a […]
- How Can I get Pivot Type Data using T-Sql I got requirement that needs to display top 3 salary Employee. It got query which displaying top 3 employee names like this:
select top 3 [Employee First Name]+' '+[Employee Surname] as […]
- Please provide assistance with complicated join across 7 related tables I have a table of products (Product) with ID and Name. I have a linking table called ProductCondition with 3 fields (ID, ProductID, ConditionID). Each Product can have more than one […]
- Obtain maximum row_number inside a cross apply I am having trouble in calculating the maximum of a row_number in my sql case.
I will explain it directly on the SQL Fiddle example, as I think it will be faster to understand: SQL […]
- SQL Server – Create a new database for a user and ONLY give them access / view rights to that one DB I have admin rights on a SQL Server 2012 Server and have a user that wants me to create a "throw away" database for them on the server.
Basically, I'm looking to:
Create this […]
- Unable to insert data into a certain table So I am literally a new DBA and my machine has not been properly setup yet so every time someone sends in a request for an unknown error I am in charge of searching google for answers […]
- How to use Results column with Having clause I have a stored procedure,
I want to use HAVING clause with columns IsUserFruitEater and IsUserOnSite but it says column not exists.
Not sure how to use columns, there must be a way to […]
- upgrading to SQL server 2012 from 2005 is there any issues in upgrading SQL server 2005 to SQL server 2012. There are many different applications running on the databases. Kindly let me know if there is any known issue that I […]
- Does sequence contain 5 numbers that are each one apart solved recursively This is the data:
create table #t
insert into #t