tags:

views:

47

answers:

2

(for sql server - in sql server management studio)

I am having a few tables in my db with some data in those tables. I want to to transfer that data to my server; on that server I can run SQL queries. How can i generate the SQL to this?

A: 

First, generate scripts for table structure and run the scripts on your target server, then use the bcp tool (see http://msdn.microsoft.com/en-us/library/ms162802.aspx) to migrate the data.

naivists
i have generated scripts please tell abt bcp tool
Praveen Prasad
I'm not sure I fully understood the original problem - do you have access to the target server so you can run executables on that?
naivists
see 1> i can run sql queries on my server and with that i have created table structure on my server (firstly i ran generate script wizard on pc's sql management studio which created a sql script which i ran on my server)2>now tables on my pc's sql management studio is having some data, i just want to create an sql script to insert data , which i can run on my server
Praveen Prasad
then you should take a look at http://vyaskn.tripod.com/code.htm#inserts
naivists
also, there is a very similar topic here in Stack Overflow: http://stackoverflow.com/questions/422847/are-there-any-free-tools-to-generate-insert-into-scripts-in-ms-sql-server
naivists
A: 

Take a backup of the database and copy that .bak file to your server, then use restore database option of SQL Management studio to restore the database from that .bak file.

Thanks

Mahesh Velaga