By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,378 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,378 IT Pros & Developers. It's quick & easy.

call script from another script

P: n/a
OD
Hello,

Is it possible with sqlserver to call a sql script from another sql script,
like @ in oracle ?

Thanks,

Olivier
Mar 25 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Is it possible with sqlserver to call a sql script from another sql
script, like @ in oracle ?
You can call another script using ":r" in SQLCMD (or SSMS in SQLCMD mode).
For example:

:r C:\SqlScripts\Script1.sql

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"OD" <ol***************@free.frwrote in message
news:47***********************@news.free.fr...
Hello,

Is it possible with sqlserver to call a sql script from another sql
script, like @ in oracle ?

Thanks,

Olivier
Mar 25 '08 #2

P: n/a
OD
Thanks, it works very well.

Is there an equivalent for sqlserver 2000 ?

Olivier.

"Dan Guzman" <gu******@nospam-online.sbcglobal.neta écrit dans le message
de news: ZU****************@newssvr22.news.prodigy.net...
>Is it possible with sqlserver to call a sql script from another sql
script, like @ in oracle ?

You can call another script using ":r" in SQLCMD (or SSMS in SQLCMD mode).
For example:

:r C:\SqlScripts\Script1.sql

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"OD" <ol***************@free.frwrote in message
news:47***********************@news.free.fr...
>Hello,

Is it possible with sqlserver to call a sql script from another sql
script, like @ in oracle ?

Thanks,

Olivier

Mar 26 '08 #3

P: n/a
OD (ol***************@free.fr) writes:
Thanks, it works very well.

Is there an equivalent for sqlserver 2000 ?
As I recall, :r works in OSQL as well. And OSQL comes with SQL 2000.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Mar 26 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.