Generate script with insert of tables in sql server

1

I use Sql Server 2012. I made a query with the title above and did not bring anything in the search. I have a BD and I need to take you somewhere else. So, the best way is to generate a script of all the existing objects in it and since I have populated tables, I also need to generate a insert script. How do I do this, the insert script?

    
asked by anonymous 11.12.2017 / 20:02

1 answer

3

Enter Management Studio and right click on the database to be exported.

Access the Tasks menu > Generate Scripts by Image

Willopenawizard.Youchoosewhatkindofdatayouwanttoexport(tables,views,functions...)andmoveforward.

Inthesecondstepyouclick"advanced" and change the "type of data to script" item to "schema and data" otherwise the script will generate the database structure but will not insert the data! View image

Nowyoujusthavetogonexttothewizardanditwillgeneratethefileinyour"Documents" folder (or the place you select).

    
11.12.2017 / 20:31