Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,

I am new to sqlserver and i am trying to generate a script file for creating a database with data, but when i generate script file am not getting data from the tables.

i don't want all the data from all the tables.

i want the data from specific tables.

how to do that.


Regards,
Nagaraju
Posted
Comments
walterhevedeich 5-Aug-11 2:21am    
Show us the script.

The easiest way is to look at an existing example, or use that yourself.

Open the SQL Management Studio, and right click on your database. Under "Tasks", select "Generate Scripts..." In the dialog that follows, press "Next" until you get to the part asking where to save it. Select somewhere sensible, and click the "Advanced" button. Look for the "Types of data to script" option (it should be at the bottom of the "General" category). Select "Schema and data". Press "OK" and "Next" until the file has been generated.
If you look at the file, it will be a complete script to regenerate your database, complete with data.
 
Share this answer
 
if you use sql server management studio it is very simple to create these scripts for you.
Right click on the databasename, choose tasks and then generate scripts
 
Share this answer
 
Comments
nm.nagaraju 5-Aug-11 3:19am    
I am not getting the data from the tables and i am getting only structure of the database.
Herman<T>.Instance 5-Aug-11 3:23am    
Right click on the databasename, choose tasks and then Export Data

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900