Wednesday, January 26, 2011

Copy a table from one database to another database in SQL

Open a new query window in SQL server Management studio. in which database you want to copy a  table. Type

into new_name_of_table 
from old_database.table_name.

such as:
select* into Appointments from IEMS2.dbo.Appointments

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...