Database Publishing Wizard (“SqlPubWiz.exe”) is an easy way to generate database scripts.It is already installed in sql server 2005 or higher versions. If you do a full installation of VS2010 Professional, you should get the Microsoft SQL Server Database Publishing Wizard 1.4 installed as well. It located in the path: C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Publishing\1.4\SqlPubWiz.exe. How to open wizard from visual studio
In addition, to see whether it is installed on your machine, please check it in the Control Panel->Programs and Features
You can also download it from :- http://go.microsoft.com/fwlink/?LinkId=119368 When you run the “SqlPubWiz.exe”, it will open the database publishing wizard.
from SQL server management studio it will open in following way :-
Right click on database--> tasks --> Generate scripts...
It will open a new window of Sql server scripting wizard like :-
On click on Next button it will ask about database selection.
Here are so many options.Its up to you how you like to customize it.
In sql server 2008 you have an option of generate insert scripts also.
mark script data to true.
Here it will ask for chose object type like sachems,store procedure, tables, User defined functions,users,views..
here i choosed Table object.
Then it will ask you for which table you want to generate scripts