473,586 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running SQL scripts within a VB enviroment.

Hi all, I think I have the right group, if I don't then I do
apologize.
My problem is that I'm trying to run a SQL script within a VB
Environment. The actual program is WISE Installer, but I'm sure that
the same problem arise within VB because we have also wrote an app
that is meant to run SQL scripts (But falls over the same). Basically,
there are some SQL keywords that are Query Analyser only.. ie: GO

Does anyone know of a list of Query only statements? The code below
fails, but since it's not as verbose as Query, all I'm getting is
'INCORRECT SYNTAX NEAR THE KEYWORD "PROCEDURE" . Here's what's around
it:

^^^^^^^^^^^^^^^ ^^^ More stuff above
SET ANSI_NULLS OFF

CREATE PROCEDURE ASP_Outstanding StaffingRequire ments
@stDate as datetime, @enDate as datetime, @locId as integer,
@gradeCount as Integer
AS

Create Table #glb_outshifts
^^^^^^^^^^^^^^^ ^^^^ More stuff below.
Any help would be great as I'm banging my head against the wall here.

BTW.. I don't actually know what the SQL script does, I'm just trying
to package together a deployment solution.

Many Many Thanks. Regards Mark (SQL GURU.. LOL)
Jul 20 '05 #1
2 5066
Two things:
- what library are you using to run this? ADO? DMO?
- CREATE PROCEDURE must be the first statement in a batch. You should
set the ANSI_NULLS in the connection string or send it as a separate
call to the exec method of your class before executing the CREATE PROC
statement.
Does anyone know of a list of Query only statements? The code below
fails, but since it's not as verbose as Query, all I'm getting is
'INCORRECT SYNTAX NEAR THE KEYWORD "PROCEDURE" . Here's what's around
it:

^^^^^^^^^^^^^^^ ^^^ More stuff above
SET ANSI_NULLS OFF

CREATE PROCEDURE ASP_Outstanding StaffingRequire ments
@stDate as datetime, @enDate as datetime, @locId as integer,
@gradeCount as Integer
AS

Create Table #glb_outshifts
^^^^^^^^^^^^^^^ ^^^^ More stuff below.

Jul 20 '05 #2
ma**@uunix.com (Mark Davies) wrote in message news:<f8******* *************** ****@posting.go ogle.com>...
Hi all, I think I have the right group, if I don't then I do
apologize.
My problem is that I'm trying to run a SQL script within a VB
Environment. The actual program is WISE Installer, but I'm sure that
the same problem arise within VB because we have also wrote an app
that is meant to run SQL scripts (But falls over the same). Basically,
there are some SQL keywords that are Query Analyser only.. ie: GO

Does anyone know of a list of Query only statements? The code below
fails, but since it's not as verbose as Query, all I'm getting is
'INCORRECT SYNTAX NEAR THE KEYWORD "PROCEDURE" . Here's what's around
it:

^^^^^^^^^^^^^^^ ^^^ More stuff above
SET ANSI_NULLS OFF

CREATE PROCEDURE ASP_Outstanding StaffingRequire ments
@stDate as datetime, @enDate as datetime, @locId as integer,
@gradeCount as Integer
AS

Create Table #glb_outshifts
^^^^^^^^^^^^^^^ ^^^^ More stuff below.
Any help would be great as I'm banging my head against the wall here.

BTW.. I don't actually know what the SQL script does, I'm just trying
to package together a deployment solution.

Many Many Thanks. Regards Mark (SQL GURU.. LOL)


The error is probably because CREATE PROC must be the first statement
in a batch, so you need GO after the SET statement above.

A simple approach for multi-batch scripts is to use OSQL.EXE, which
will run the complete input file, even if it includes batch
delimiters. It's also very easy to direct the output to a log file in
case there are errors, so you can produce an installation log. Whether
or not this is a good solution in your case, I don't know, as I have
no experience of the WISE tools.

Simon
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3311
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the hosting available to me for this particular page prohibits me from using php/mysql as i would like. my script works simply by using output buffers...
0
1311
by: Russell E. Owen | last post by:
I have a Python/Tkinter remote control application and want to add support for running user scripts. I would like the scripts to be written in python, would like them to be able to update Tkinter widgets and (the hard part) would also like them to be capable of pausing until some condition is met (e.g. a remote control command finishes)...
2
3732
by: Tim Daneliuk | last post by:
Given that setuid is a Bad Thing for scripts, what is the general consensus here on running a Python script via 'sudo' to give it root system access? Is this reasonably secure, or am I still asking for trouble? TIA, -- ---------------------------------------------------------------------------- Tim Daneliuk tundra@tundraware.com PGP...
1
1693
by: sub1ime_uk | last post by:
I apologise if this is a well known problem. I've searched and can't find a clear description or fix. Hope someone can help. I am running my Python scripts under Windows 2000 using Python 2.4 Build 243 from Activestate. If I want to specify a file as standard input to my script I can just enter a command like: H:\> pyscript.py file.inp
2
4855
by: Dave Hughes | last post by:
Just noticed something rather annoying after upgrading my test box (a Linux server running DB2 UDB v8 for LUW) to fixpak 11 (for reference it was previously on fixpak 7). In the past I've relied heavily on the ability to start multiple long-running SQL scripts in the background and have them all run in parallel. Unfortunately, it seems that...
24
2827
by: Mark | last post by:
Hi, I'm new to python and looking for a better idiom to use for the manner I have been organising my python scripts. I've googled all over the place about this but found absolutely nothing. I'm a linux/unix command line guy quite experienced in shell scripts etc. I have a heap of command line utility scripts which I run directly. What is...
2
1164
by: rodmc | last post by:
I am new to using Python as a CGI platform, so please excuse me if this is a dumb question. Anyway I have written a series of web forms (with Python scripts) which allow the user input but also retrieve data from a database. The data entry stage works fine however retrieving data is a little more tricky. However I need to find a way to call...
4
1679
by: Jonathan Wood | last post by:
I'm trying to duplicate an HTML sample I have using my ASP.NET pages. The sample contains the following within the <headtag: <script type="text/javascript" src="flashobject.js"></script> <script type="text/javascript"> // <!.indexOf('='); if( pos == -1 ) { continue; // Look for "name=value"
1
1527
by: sverkaik | last post by:
I have a PHP script which needs to run some other PHP scripts from within it. I need them to be executed on a timed basis, say, every minute. However, they can take a little while to run, and I do not need a response. Unfortunately, the only solutions I have found all require me to be on a Unix system, but this server is running windows. ...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8200
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.