How to export data from SQL Server 2008.2010 in DM

2020-03-01 07:45发布

Is there a tool or special query to do that. I'm not an database administrator.

4条回答
▲ chillily
2楼-- · 2020-03-01 07:45

Do you mean generating data script? If it is so then simply right click on the database name -Generate Scripts. In the advanced option in the wizard you get to choose "Type Of data script to add". Select data only there and you can get the data script

查看更多
家丑人穷心不美
3楼-- · 2020-03-01 07:51

Have you tried using SSMS tool pack? It is one of the best addins for SSMS.

查看更多
做自己的国王
4楼-- · 2020-03-01 07:54

to what format? are you only referring to 1 table or the whole database?

if you are exporting to an excel file from 1 table then all you have to do is run a sql query statement to display all records then highlight all rows thru clicking on the top most right space of the grid and right click copy with column headers.

open excel and paste.

should be good to go.

查看更多
Juvenile、少年°
5楼-- · 2020-03-01 08:08

Here are the steps to generate the scripts from a database along with data. The screenshots were taken using SQL Server 2012 Management Studio but I believe that the steps are similar for SQL Server 2008 as well.

  • Connect to the instance in which you would like to scrip the database along with data.
  • Right-click on the database and select the option Tasks --> Generate Scripts...

tasks generate scripts

  • On the Generate and Publish Scripts wizard, click Next button.

introduction

  • On the Choose objects step, I have left the default selection Script entire database and all database objects checked. You can also select the option Select specific database objects and pick the objects of your choice.

Choose objects

  • On the Set Scripting Options step, select the path where you would like to save the script. Click on the Advanced button.

set scripting options

  • On the Advanced Scripting Options dialog, scroll down to the option Types of data to script. By default, this is set to Schema only, which means it will generate only the create object statements. If you want both object creation script along with data, select the option Schema and data. Click OK on the Advanced Scripting Options dialog and click Next on the Set Scripting Options step

advanced scripting options

  • On the Summary step, it will show all the options that you had selected. Click Next.

summary

  • On the Save or Publich Scripts step, if everything goes well you will see Success status appear against each object and the script should be saved to the location that you specified on the Set Scripting Options step.

save or publish scripts

Scripting the entire AdventureWorks database turned to be a huge 522 MB script file!

Hope that helps.

查看更多
登录 后发表回答