PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > call script from another script
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
call script from another script

Réponse
 
LinkBack Outils de la discussion
Vieux 25/03/2008, 10h46   #1
OD
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut call script from another script

Hello,

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

Thanks,

Olivier


  Réponse avec citation
Vieux 25/03/2008, 14h06   #2
Dan Guzman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: call script from another script

> 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 s.

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

"OD" <olivier.dubuisson@free.fr> wrote in message
news:47e8bc04$0$17714$426a74cc@news.free.fr...
> Hello,
>
> Is it possible with sqlserver to call a sql script from another sql
> script, like @ in oracle ?
>
> Thanks,
>
> Olivier
>


  Réponse avec citation
Vieux 26/03/2008, 16h30   #3
OD
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: call script from another script

Thanks, it works very well.

Is there an equivalent for sqlserver 2000 ?

Olivier.

"Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> a écrit dans le message
de news: ZU5Gj.5356$6H.4146@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 s.
>
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
>
> "OD" <olivier.dubuisson@free.fr> wrote in message
> news:47e8bc04$0$17714$426a74cc@news.free.fr...
>> Hello,
>>
>> Is it possible with sqlserver to call a sql script from another sql
>> script, like @ in oracle ?
>>
>> Thanks,
>>
>> Olivier
>>

>



  Réponse avec citation
Vieux 27/03/2008, 00h40   #4
Erland Sommarskog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: call script from another script

OD (olivier.dubuisson@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, esquel@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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h29.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08540 seconds with 12 queries