I have Sql Server DB, I know I can Create thru "Generate Scripts" backup for SP and Functions then I just replace inside the script the "CREATE" with "ALTER", that will update the target DB with the latest Functions And SP but how to do that for Tables structures and "User Defined Tables" ?
Sql-server – how to create backup for update tables structures in existing DB
sql serversql-server-2005sql-server-2008
Related Question
- Sql-server – How to implement a quick backup and restore strategy for database script testing
- SQL Server – Generate Backwards Compatible CREATE DATABASE Script
- SQL Server 2014 – How to Generate Partition Function and Schema Scripts
- SQL Server – Generating CREATE DATABASE FOR ATTACH for All User Databases
- Sql-server – SSIS: How to create tables using Foreach Loop Container
- SQL Server User Permissions – How to Grant User Permission to Create Table Without Seeing Other Tables
- SQL Server – Update All Data in All Tables from Backup
Best Answer
The process of synchronizing the schema between two databases is not a simple one. In general, you will need to either write change scripts manually using
ALTER TABLE
commands or use specifically designed software which will generate theALTER
statements for you.Either way, any error can cause loss of data on a massive scale if you select the wrong column to delete, or make your
varchar(30)
into avarchar(3)
column.I can recommend you take a look at RedGate's SQLCompare, Visual Studio Ultimate or Premium, and SQL Server Data Tools - which is free. All three will take two databases, backups or scripts and generate the DDL needed to move from one to the other.