Hey guys today i wanted to export my all schema and data from a database to a script file. While i was searching on the net i found the following command that we can you. Hope this will be helpful to you guys too. Command to run which will create schema and database: C:\Program Files\Microsoft SQL Server\90\Tools\Publishing\1.4\sqlpubwiz script -d AdventureWorks “C:\AdventureWorks.sql” Command to run which will create schema: C:\Program Files\Microsoft SQL Server\90\Tools\Publishing\1.4\sqlpubwiz script -d AdventureWorks “C:\AdventureWorks.sql” -schemaonly Command to run which will create data: C:C:\Program Files\Microsoft SQL Server\90\Tools\Publishing\1.4\sqlpubwiz script -d AdventureWorks “C:\AdventureWorks.sql” -dataonly http://blog.sqlauthority.com/2007/11/16/sql-server-2005-generate-script-with-data-from-database-database-publishing-wizard/