473,383 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Calling a script within a script

17
Ok I have been searching for days now, so I hope there is someone here who can help me.

Is there anyway to call a sql script from within a sql script under MS SQL-Server 2005, i.e. a master install script calls a number of smaller scripts to fill out the tables.
Jan 15 '07 #1
5 18149
bplacker
121 100+
have you tried just inserting the code to call the script where you want it to be called? If so, what happened when you did?
Jan 15 '07 #2
almaz
168 Expert 100+
See EXEC and sp_executesql.
Jan 15 '07 #3
Normann
17
I am not sure that is what I need. What I am hoping to accomplish is:

Opening the master install script (D:\DBSCRIPTS\StoreAddIn\masterinstall.sql)in Server Management Studio, and when executing this script it also runs the other scripts as well. The Scripts are all in different physical files i.e.
D:\DBSCRIPTS\StoreAddIn\AddChange.sql
D:\DBSCRIPTS\StoreAddIn\AddNewItems.sql
etc.

Normally I would just add them into one script and run that, but we have about 25 scripts to run every other day, and if I add all of them together it fast becomes difficult to keep things separated.

From what I have been able to read about the two functions you mentioned, it is not what I need.

Normann
A frustrated SysAdmin
Jan 16 '07 #4
almaz
168 Expert 100+
Than you can use SQLCMD mode in Server Management Studio and following syntax:
Expand|Select|Wrap|Line Numbers
  1. use MyDatabase
  2. go
  3. :r D:\DBSCRIPTS\StoreAddIn\AddChange.sql
  4. go
  5. :r D:\DBSCRIPTS\StoreAddIn\AddNewItems.sql
  6.  
Jan 16 '07 #5
Normann
17
Thank you for your help, it works now. That will save me a lot of work and time.

Normann
A slightly less frustrated SysAdmin
Jan 16 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: bhennon | last post by:
Hey all, I have a small php script that calls a random image at the following page. http://www.2006ymcanationals.com/random.php IT WORKS IF I go directly to the above link. I am trying to...
8
by: Jakej | last post by:
I've been using a javascript in an html file for a banner slider, and it works as desired. But I'd like to use it on more than one page and it would be great if I could transfer the code to a .js...
14
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
8
by: Brett Robichaud | last post by:
I understand how code-behind can handle events for a page, but can I call a code-behind method from within a <script> tag in my ASP.Net page, or can I only call methods defined in other <script>...
4
by: Martin Feuersteiner | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB...
13
by: ukrbend | last post by:
I'm new to Javascript and to html and am trying to make the following code snippet work but it doesn't. It refuses to call the getPage() function and I always get a 404 error. I know the code is...
1
by: =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post by:
Hi, I have a the following javascript code(see below) within my asp.net page, I would like to be able to set the value of UnSavedChanges within my c# behind code to indicate that changes have been...
11
by: Emmanouil Angelakis | last post by:
Hi, I am tryiong to do something obviously trivial such as: I have a c program called "tsys2list" that when it is ran it asks the user to give the value of "tcal" which is a variable. I want to...
9
by: mrcheeky | last post by:
Hi, I'm stuck, but it's almost working! From a html page, my javascript calls a server-side php script. The php reads a value from a server-side .txt file and passes it back as a javascript...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.