Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to call one .sql file from another?

Author  Topic 

cddot
Starting Member

37 Posts

Posted - 2009-06-17 : 02:52:32
For eg,


select count(*) from tab1;

run file1.sql
run file2.sql

select * from tab2;


So what is the correct word/symbol to use, instead of "run" which is not valid syntax?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-17 : 03:03:18
There are examples in the Library forum, posted by MVJ, Michael Valentine Jones.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

cddot
Starting Member

37 Posts

Posted - 2009-06-17 : 03:31:39
If I know what keywords to search for, I can do a search.

Searching for MVJ doesn't really help, cause he's a helpful guy with lots of entries.

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-17 : 03:40:10
I'd try this link
http://www.lmgtfy.com/?q=%22Execute+Script+from+a+File%22+%22michael+valentine+jones%22



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

cddot
Starting Member

37 Posts

Posted - 2009-06-17 : 03:49:06
You would try that link of course.

Since you already know the word to search for is "execute".

Thanks for the sarcasm thrown in for free.



Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-17 : 04:20:18
Actually it took me about 1.5 minutes to browse the Library forum for the topic above.
It took me longer time to post the result here...



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

cddot
Starting Member

37 Posts

Posted - 2009-06-17 : 04:32:30
The posted link is helpful, thanks.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-17 : 04:50:04
You're welcome.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -