IMPORTANT : This method is only applicable if your database size is under couple of hundred MBs. If you script out big databases with schema and data, the script might get huge and could not handled by Management studio or SQLCMD.
- Connect to MS SQL Server 2012 using Management Studio.
- Expand the Databases and right click on the database you want to script. Select Tasks >> Generate Scripts option.
- Skip the introduction screen and click on Choose Objects option.
- Keep checked an option of script entire database and all database objects and click on Set Scripting Options.
- On the specify how scripts should be saved or published page, click Advanced.
- Under General, locate Types of data to script and change it from Schema only to Schema and data. Change Script for Server Version from SQL Server 2012 to SQL Server 2008. Make sure you set the correct target version of SQL Server 2008 here.
- Click on OK. Click on Next 2 times and then Finish.