Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2010, 09:21 AM
Registered User
 
Join Date: Aug 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Executing Multiple Scripts

I need a SQL Server equivalent

I need to create one script that will execute several other scripts.

Using Oracle I can create a file called foo.sql, which is made up of other scripts names. For example, if I were to open foo.sql it contains:

@c:\temp\a
@e:\mystuff\b

And then by either invoking sqlplus via the command line or the GUI I can run

@foo

and it executes both a.sql and b.sql


What is the equivelent in SQL Server Management Console that I could run that would do the same thing?

Thanks in advance

Scout14
 
Old September 16th, 2010, 06:54 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

I believe that what you're looking for is OSQL. Either that or you can create a "graphical" script using SSIS. Read about both in Books Online which is the help system that comes with SQL Server.
__________________
--Jeff Moden

Last edited by Jeff Moden; September 16th, 2010 at 06:56 PM..
 
Old September 16th, 2010, 06:58 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

And, no... it's not a 100% equivalent. There's not much that's 100% equivalent between Oracle and SQL Server.
__________________
--Jeff Moden
 
Old September 17th, 2010, 09:22 AM
Registered User
 
Join Date: Aug 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Executing Multiple Scripts

While I'm not looking for an "exact" match I am looking for something similar.

And I guess what I am really looking for is for someone to show me an example.

Can I create a script called foo and have it contain other script names that through OSQL or SQL Server Management Console, New Query window, execute foo?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing Oracle Scripts from ASP Page acpt Classic ASP Basics 0 May 3rd, 2005 08:33 AM
Downloading scripts... johnh Oracle 0 May 23rd, 2004 10:17 AM
SQL Scripts sridevi SQL Server 2000 8 May 20th, 2004 12:11 AM
Scripts Format rgerald SQL Server 2000 1 July 10th, 2003 12:53 PM
executing multiple statements jae_green PHP Databases 1 July 7th, 2003 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.