How to import .sql file into SQL Server Express

I have a simple sql file with some SQL INSERT statements.

Can I import it in my local instance of SQL Server Express?

+6
source share
5 answers

You can use the version of Management Studio Express. You can download the latest version here - which will work against SQL Express 2005, 2008 and 2008 R2.

If you do not want to install SSMSE, you can use sqlcmd on the command line, for example. something like this (assuming Windows auth and an instance called "SQLEXPRESS"):

sqlcmd -S .\SQLEXPRESS -E -i "C:\path\file.sql" 
+10
source

The easiest way is to simply open the file in Sql Management Studio and run it. Since the target table has already been created, of course.

+2
source

You can open it using the query analyzer and run

0
source

Here is the Sql_Server_Script_Executor tool

enter image description here

You can add one / several files / folders and your files will appear in the list. Click the Run button and execute

 It contains three transaction modes. 1. Execute scripts within one transaction 2. Execute scripts on separate transaction 3. No transaction 
0
source

All you have to do is open Microsoft SQL Server 2008 Management Studio. Then use File Open .

Open the file from the appropriate location and you will get all the SQL statements. After that you can execute them.

Hope this helps.

0
source

Source: https://habr.com/ru/post/891724/


All Articles