J
J
JackBoner2015-01-14 15:18:18
ASP.NET
JackBoner, 2015-01-14 15:18:18

How to import sql table into SQL Server in Visual Studio 2013?

There is a sql table that was unloaded from the same Visual Studio.
Its contents are

INSERT INTO [dbo].[Table] (...) VALUES(...)
...

and there are about 2000 such lines. 8 mb
Therefore, because of the large volume, it is simply impossible to push this into a query to the table through the clipboard. (Out of memory expection, or just does not copy)
When I try to just open the file through the visual and execute the SQL query, I get the "object not found" error. This is most likely due to the fact that the database itself is not selected.
So how do you quickly export/import data to a local SQL Server?
And not a complete dump and restore of the entire database, but import and export of individual tables.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Nemiro, 2015-01-14
@JackBoner

Create many small files and import with bat -name:

@echo off
for /r C:\путь к папке с файлами .sql %%g in (*) do SQLCMD.EXE -d [в какой базе выполнить запросы] -i "%%~nxg" -o "%%~nxg.log"

Or, if the database was created in Visual Studio , then the easiest way would be to simply connect it to SQL Server Management Studio .
20b6d487800e44eba3a4bd22de67c34d.png

I
Ivan Filatov, 2015-01-14
@NYMEZIDE

start SQL Management Studio and do everything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question