Search code examples
sql-serverdatabasesql-server-2008sql-server-2012export

How to export database with data in MSSQL?


How can I export my 2012 database with data to a .sql file so I can import it to a 2008 server? I've never been able to export the data only the structure.


Solution

  • You can right click on the database in management studio. then go to,

    Tasks --> Generate scripts --> Advanced
    

    There you can enable "Type of data to script" as Schema and data, then generate the script. So that your script file will be populated with your data in table.