# Call sql script from sql script

**URL:** <https://forums.percona.com/t/call-sql-script-from-sql-script/805>\
**Category:** Other MySQL® Questions\
**Created:** [June 18, 2008, 2:26am UTC](https://forums.percona.com/t/call-sql-script-from-sql-script/805 "2008-06-18T02:26:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcernik](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@jcernik](https://forums.percona.com/u/jcernik)\
**Post date:** [June 18, 2008, 2:26am UTC](https://forums.percona.com/t/call-sql-script-from-sql-script/805/1 "2008-06-18T02:26:27Z")

</div>

I need to split my sql script into several files.  
Logic: master sql file calling several other sql files.  
How is this possible with MySQL 5.0.51 + MS Win?  
THX!  
Jan

---

<div class="post-metadata">

**Author:** ![debug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/debug/32/772_2.png) [@debug](https://forums.percona.com/u/debug)\
**Post date:** [June 19, 2008, 1:45am UTC](https://forums.percona.com/t/call-sql-script-from-sql-script/805/2 "2008-06-19T01:45:09Z")

</div>

Hmm, doesn’t it work?

. /path/to/script1  
. /path/to/script2  
. /path/to/script3

---

<div class="post-metadata">

**Author:** ![jcernik](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@jcernik](https://forums.percona.com/u/jcernik)\
**Post date:** [June 19, 2008, 2:53am UTC](https://forums.percona.com/t/call-sql-script-from-sql-script/805/3 "2008-06-19T02:53:12Z")

</div>

Unfortunatelly not.  
Details:  
-I have DB with table quals\_TBL  
-master script “master.sql” should call 2 slave scripts “slave1.sql”, “slave2.sql”  
-running master.sql generates error:  
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘. /ABC/slave1.sql  
. /ABC/slave2.sql’ at line 1  
-I have tried also c:\ABC\slave1.sql with the same result

-server: MySQL 5.0.51a-community-nt via TCP/IP  
-client: MySQL Client Version 5.1.11  
-to manage DB I use MySQL Administrator 1.2.12  
-to run master.sql I use MySQL Query Browser 1.2.12

File c:\ABC\master.sql:  
. /ABC/slave1.sql  
. /ABC/slave2.sql

File c:\ABC\slave1.sql:  
INSERT INTO quals\_TBL (contacts\_id\_INT, qualTypes\_id\_INT, number\_STR, valid\_DT)  
VALUES (2,2,‘hello’,‘1.1.2008’);

File c:\ABC\slave2.sql:  
INSERT INTO quals\_TBL (contacts\_id\_INT, qualTypes\_id\_INT, number\_STR, valid\_DT)  
VALUES (4,4,‘hello’,‘1.1.2008’);
