Thursday, 17 April 2014

SQL SERVER 2008 & 2008 R2 - Create Script to Copy Database Schema and All The Objects - Data, Schema, Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects

Quite Often we get request regarding how to copy all the objects - including schema and data from any database and re-create it on another instance.

SQL Server 2008 & SQL Server 2008 R2 has script generator wizard which does it for us.









Pay attention to the option Types of data to script - select option "Schema and data"










After the script is generated, the next challenge often users face is how to execute this large script as SSMS does not open the file. One can use SQLCMD for the same as shown in the following image

As the file with data will be very large, use SQLCMD to execute the larger script which will create with schema & data.





SQL Server Query Execution Plans for beginners – Clustered Index Operators

In this article we will continue discussing the various execution plan operators related to clustered indexes and what they do, when do the...