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.
| Author |
Topic |
|
MikeNau
Starting Member
1 Post |
Posted - 2003-02-13 : 16:31:42
|
| Is there a way to use a text file to load other files containing valid sql statements?For example, the file load_views.sql contains the following:read login_view.sqlread user_view.sqlIdeally, I would pass in the load_views.sql file to osql and it would then load login_view.sql and user_view.sql files.Any ideas?Thanks,Mike. |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2003-02-13 : 16:35:39
|
| Create a .bat batch fileand include one osql line for login_view.sqland another for user_view.sqlThen when you run your .bat file it will execute both statements.You can even have conditional statements. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-02-13 : 16:40:21
|
| You could call load_views.sql with osql, then inside load_views.sql would be sql commands that call your two files with xp_cmdshell. I don't think that you want to do this though. You should just do what ValterBorges suggested instead of what you are trying to do. |
 |
|
|
|
|
|