Compare Schema of Two SQL Server Databases

Note to myself: source

SQL Server performance queries

If a popular query does not have an associated index it will have a large impact on performance. This script identifies the queries without an index.

Here are some links with scripts that can help.

1. Find queries with missing indexes

2. Find Most Commonly Used Indexes

3. Find Long Running Queries

Identify Table Fragmentation

Note to myself: source

Compare Data in SQL Server Databases

Note to myself: source

Move inactive rows to achive table via SQL statements

Check this link if you want to generate automated migrated scripts:
http://eyearchive.codeplex.com/
or create your own migration scripts.

Let’s consider the two tables:

We need a clear, transactional way to move rows from the active to the inactive tickets table.

Solution 1:

Solution 2: