From the SQL Server Management Studio you can right click on your database and select:
Tasks -> Generate Scripts - Next -> Select objects that you need from list -> click on the advanced
Then simply proceed through the wizard. Make sure to set 'Script Data' to TRUE when prompted to choose the script options.
SQL Server 2008
SQL Server 2008 R2
Further reading:
Robert Burke: SQL Server 2005 - Scripting your Database
Taken from stack overflow:
How to get script of SQL Server data?