About 278,000 results
Open links in new tab
  1. How to run sql script using SQL Server Management Studio?

    Apr 22, 2012 · Open SQL Server Management Studio > File > Open > File > Choose your .sql file (the one that contains your script) > Press Open > the file will be opened within SQL Server Management Studio, Now all what you need to do is to press Execute button.

  2. command line - How to run SQL script in MySQL? - Stack Overflow

    Jan 20, 2012 · So many ways to do it. From Workbench: File > Run SQL Script -- then follow prompts From Windows Command Line: Option 1: mysql -u usr -p mysql> source file_path.sql Option 2: mysql -u usr -p '-e source file_path.sql' Option 3: mysql -u usr -p < file_path.sql Option 4: put multiple 'source' statements inside of file_path.sql (I do this to drop and recreate schemas/databases which requires ...

  3. How can I execute a set of .SQL files from within SSMS?

    May 12, 2017 · The ":r filename.sql" command is the SQLCMD script command to import and execute a sql script file. You know you are in SQLCMD mode because any lines that are SQLCMD script commands will appear with colored (gray I think) background.:setvar path "c:\Path_to_scripts\" :r $(path)\file1.sql :r $(path)\file2.sql

  4. Execute SQL script from command line - Stack Overflow

    Firstly create an empty database in SQL server, then run this command. sqlcmd -s ServerName -d CreatedDatabaseName -i ScriptFileName.sql ScriptFileName should be with a complete path like "D:\Folder Name\ScriptFileName.sql".

  5. How to execute a SQL script in DBeaver? - Stack Overflow

    Feb 2, 2017 · Step 1: Create a New SQL Script by navigating to the appropriate option or using the shortcut (Ctrl + J). Step 2: Import the SQL Script you've just created by following these steps: Click on the context menu. Navigate to the "File" option. Choose "Import SQL Script" (Shortcut: Shift-Ctrl-Alt-O).

  6. sqlplus - executing a .sql file in sql plus terminal - Stack Overflow

    Aug 19, 2016 · I have written couple of sql scripts in a text file and saved them with a .sql extension. I want to execute these scripts in the sql plus terminal without having to manually type the standalone sql scripts, but i'm struggling with it. If someone could list out the steps involved I would be very grateful.

  7. Run a PostgreSQL .sql file using command line arguments

    Mar 16, 2012 · Walk through on how to run an SQL on the command line for PostgreSQL in Linux: Open a terminal and make sure you can run the psql command: psql --version which psql Mine is version 9.1.6 located in /bin/psql. Create a plain textfile called mysqlfile.sql. Edit that file, put a single line in there: select * from mytable;

  8. How to run script from within Mysql workbench? - Stack Overflow

    File -> Open SQL Script: This simply loads the file contents into a new SQL query tab in the SQL editor. From here, execute the query exactly like you would if you typed it in. File -> Run SQL Script: This opens the SQL script in its own "Run SQL Script" wizard that includes a [Run] button to execute the query. This only displays part of the ...

  9. How to run SQL scripts and get data on application startup?

    Sep 2, 2016 · You may define the platform with: spring.sql.init.platform=oracle. You may change the name of the sql script to load with: spring.sql.init.data-locations=myscript.sql. Along with data.sql, Spring-boot also loads schema.sql (before data.sql). You could also have an "update or insert" logic in your data.sql: oracle sql: update if exists else insert

  10. Executing set of SQL queries using batch file? - Stack Overflow

    Feb 5, 2014 · Save the commands in a .SQL file, ex: ClearTables.sql, say in your C:\temp folder. Contents of C:\Temp\ClearTables.sql. Delete from TableA; Delete from TableB; Delete from TableC; Delete from TableD; Delete from TableE; Then use sqlcmd to execute it as follows. Since you said the database is remote, use the following syntax (after updating for ...

Refresh