• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 511
  • Last Modified:

Export Data From MS SQL in INSERT INTO format

Hello,

I have a database running in MS SQL Server 2008 Express Edition.

My client has asked for a copy of the data in SQL CREATE TABLE and INSERT INTO format, rather than a raw backup.

I cant figure out how to do this from the management console.

Any help would be appreciated.
Kind Regards
Dan
0
DanJourno
Asked:
DanJourno
1 Solution
 
Kapil_GoyalCommented:
Hello

Just generate the script from Generate Script with script with data.
Just right click on the database >> Tasks >> Generate Script

Do remember to set the option "Script with data" yes.
0
 
Om PrakashCommented:
SELECT Database
right click
select Tasks
select generate scripts
this will open a wizard
You can select the tables, SPs, function you need to create script.
0
 
carsRSTCommented:
If i'm understanding you, try these steps.

1.  Get the table structure.  
     a.  Right click the table you want to backup and do following steps.
     b.  Script table as-->create to-->New Query Editor window
2.  in this output script, change the table name after "CREATE TABLE" to what ever you want to name it.
3.  On that same output script, add this at the bottom.
     "insert into [destination table] select * from [source table]

NOTE: if you are going to run multiple times, you will need to drop the table first before you run this script.

IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = ' [destination table]') DROP TABLE [destination table]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now