What if you have a large file of
insert into .....
insert into .....
insert into .....
insert into .....
insert into .....
The on;y thing I can think of is create new query then copy and paste
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I can see hw to create a files of sql commands from a database table but how do import it into another test database please. Do I use import flat file as taht appears to be for csv files. Thanks
What if you have a large file of
insert into .....
insert into .....
insert into .....
insert into .....
insert into .....
The on;y thing I can think of is create new query then copy and paste
Hi @Pamela Whittaker ,
how do import it into another test database?
Did you mean you want to import the data to another database? You can right-click on your database and select Tasks -> Generate Scripts...
In Set Scripting Options page, you can specify how scripts should be saved. And you can select the Types of data to script to be Data only in Advanced button.
If you have to perform large imports of data from a csv file, you can use BULK INSERT statement as YitzhakKhabinsky mentioned. Or you also can use SQL Server Import and Export wizard by choosing Flat File Source as Data Source with file name. Please refer to Bulk Import and Export of Data and this simple example of the Import and Export Wizard which might help..
If you have any other question, please feel free to let us know.
Best Regards,
Amelia
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Ok I am a bit nearer. I have managed to use use query options and set the delimiter to comma then run a query setting it to store to a csv file. That doesn't quite work though. It is fine unless you have a comma as part of a field entry. O dear. It isn't the whole data we want to copy - just data from a couple of tables. I understand the Bulk insert from a csv file. I hadn't come across that before. Thanks