1

Please can someone tell me how I can easily export data from a SQL Server 2012 database? I have been trying for a while now and have read several articles but I either do not understand them or they are not what I am looking for.

I want to export ONLY the data itself to a single .sql file, is this possible and if so can somebody please tell me how I can do this?

I expect the code to be generated as insert statements eg.

insert into employee(id, name, address) 
values('1', 'Yao Ming', 'No.2 NBA Street');
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Blank EDjok
  • 732
  • 2
  • 14
  • 33
  • 1
    right click on your database and select generate scripts. – Vikas Rana Feb 11 '14 at 09:53
  • 2
    @Mitch Wheat If that is the case, then wouldn't it have been much better if you had at least posted a link to one of those "many" links. If you can't be helpful then don't post at all. Thank you. – Blank EDjok Feb 11 '14 at 09:54
  • Per definition that would not be a data export but the generation of a sql script - unless you plan to do something like storing a csv file in a .SQL file extension. – TomTom Feb 11 '14 at 09:54
  • Done. VOting to close as duplicate. Reference in the closing link. – TomTom Feb 11 '14 at 09:55
  • http://stackoverflow.com/questions/12140422/generating-sql-script-through-code-c-net/12140494#12140494 – David Brabant Feb 11 '14 at 09:55

2 Answers2

1

You can use 'Task' > 'Generate Script' > 'Set Scripting Option' > Advanced > 'Types of data to script' > Select 'Data Only'. Then generate the script.

Can refer to this link also: http://www.c-sharpcorner.com/UploadFile/rohatash/generating-script-in-sql-server-2012/

BAdmin
  • 927
  • 1
  • 11
  • 19
0

Please go to phpmyadmin > Database > yourdatabasename > Export > go > copy and past code in any text editor > save in yourdatabasename.sql

mahekdhar
  • 15
  • 4