473,386 Members | 1,752 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,386 software developers and data experts.

ISQL call problem

Hello everyone!

I have the following problem. I`ve opened a Query Analyser and write the
statement:

-isql -S 'PL6XXXX' -i 'd:\SQL_Server_2000\Raport_WWW.sql'

I got the following erorr message:

Incorrect syntax near -S

How to call the statement which is placed inside the 'Raport_WWW.sql'
file, which is located on folder D:\SQL_Server_2000??? Do I have to do
it in the cmd panel???

Thank you in advance for your help
Marcin from Poland

*** Sent via Developersdex http://www.developersdex.com ***
Aug 13 '05 #1
4 3794
Marcin Zmyslowski (ma*****@kapy.bydg.pl) writes:
Hello everyone!

I have the following problem. I`ve opened a Query Analyser and write the
statement:

-isql -S 'PL6XXXX' -i 'd:\SQL_Server_2000\Raport_WWW.sql'

I got the following erorr message:

Incorrect syntax near -S

How to call the statement which is placed inside the 'Raport_WWW.sql'
file, which is located on folder D:\SQL_Server_2000??? Do I have to do
it in the cmd panel???


Yes, you must open a command-line window. Query Analyzer is for running
T-SQL commands. ISQL is a Windows program, and not an SQL command.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Aug 13 '05 #2

Uzytkownik "Erland Sommarskog" <es****@sommarskog.se> napisal w wiadomosci
news:Xn********************@127.0.0.1...
Marcin Zmyslowski (ma*****@kapy.bydg.pl) writes:
Hello everyone!

I have the following problem. I`ve opened a Query Analyser and write the
statement:

-isql -S 'PL6XXXX' -i 'd:\SQL_Server_2000\Raport_WWW.sql'

I got the following erorr message:

Incorrect syntax near -S

How to call the statement which is placed inside the 'Raport_WWW.sql'
file, which is located on folder D:\SQL_Server_2000??? Do I have to do
it in the cmd panel???


Yes, you must open a command-line window. Query Analyzer is for running
T-SQL commands. ISQL is a Windows program, and not an SQL command.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp


How would the statement look like if I would like to open run in in Query
Analyser??

Thank you very much for help
Marcin
Aug 13 '05 #3
Stu
Hey Marcin,

Let me see if I can clarify Erland's statement a bit: there are 3
client applications that you can use to run SQL commands against a SQL
server:

isql Utility
The isql utility allows you to enter Transact-SQL statements, system
procedures, and script files; and uses DB-Library to communicate with
Microsoft® SQL Server™ 2000.

The osql utility allows you to enter Transact-SQL statements, system
procedures, and script files. This utility uses ODBC to communicate
with the server.

The isqlw utility (SQL Query Analyzer) allows you to enter Transact-SQL
statements, system stored procedures, and script files. You can set up
shortcuts or create batch files to launch a preconfigured SQL Query
Analyzer.

isqlw (Query Analyzer) is most often run like a standard Windows app;
it has a GUI, which you are used to using to type in SQL statements;
the other two are run from a command prompt from windows, and can be
started up with a variety of options (including executing a .sql file).
If the SQL statements you want to run are located in a file
(Report_WWW.sql) that you want to execute using Query Analyzer's GUI,
you need to go to the File... Open... option on the menu and open the
file like you would any windows document. You can then run the file
using CTRL-E.

Does that make sense? Of course, given that you didn't know that
indicates that you probably are just starting out with Query Analyzer.
Be sure that you trust this SQL file that you are opening; you can do a
lot of nasty things with an unprotected SQL Server.

HTH,
Stu

Aug 14 '05 #4
Kamyk (ma**************@poczta.onet.pl) writes:
Uzytkownik "Erland Sommarskog" <es****@sommarskog.se> napisal w wiadomosci
I have the following problem. I`ve opened a Query Analyser and write the
statement:

-isql -S 'PL6XXXX' -i 'd:\SQL_Server_2000\Raport_WWW.sql'

I got the following erorr message:

Incorrect syntax near -S

How to call the statement which is placed inside the 'Raport_WWW.sql'
file, which is located on folder D:\SQL_Server_2000??? Do I have to do
it in the cmd panel???


Yes, you must open a command-line window. Query Analyzer is for running
T-SQL commands. ISQL is a Windows program, and not an SQL command.


How would the statement look like if I would like to open run in in Query
Analyser??


In addition to Stu's reply, you *can* invoke ISQL from SQL Server by running
xp_cmdshell:

EXEC master..xp_cmdshell
'-isql -S "PL6XXXX" -i "d:\SQL_Server_2000\Raport_WWW.sql"'

However, normally you need sysadmin rights to run xp_cmdshell. And,
the file path where would be on the machine on which SQL Server is
running, so if this file is on your workstation, ISQL would not find it.
Unless, that is, the SQL Server you are connecting to is on your on
workstation.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Aug 14 '05 #5

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

Similar topics

0
by: Rui Cunha | last post by:
Hi, i'm having some problems at work with isql*plus in what concerns with session timeouts... here is the scenario: a class with 30/40 students working on PL/SQL and requesting the database...
1
by: Jacob Grydholt Jensen | last post by:
I am trying to learn iSQL*Plus for the 1Z0-007 exam. I am having a bit of problems with the substitution variables. My understanding was that they behave as in SQL*Plus, but my experiments beg to...
6
by: Alex Vilner | last post by:
Hello! We have a set of individual .SQL scripts which we would like to execute against a MS SQL Server 2000. Is there any way to have ISQL utility (or any other means) to execute all of them...
5
by: Jay Chan | last post by:
I am trying to use a command line program to run a stored procedure that generates output in a comma-delimitted format. Somehow, ISQL or OSQL always wrap the lines at 256 characters. I believe this...
1
by: Gary | last post by:
I want to run and 'Alter Database' statement from within a batch file. The batch file is to be run from an external automation program, (don't ask why).. I know the syntax for the alter db...
3
by: anuu | last post by:
Hi, I have created a database as pubs.qa and wrote a command utility to query a table. isql -S server -E -d pubs.qa -i qry.sql -b -n contents of qry.sql
3
by: yanakal | last post by:
Hi, I'm using isql to query data and output the same to a flat file. The isql has the following command options ' -h-1 -w500 -n -b -s"" '. In the SQL_CODE, the first two lines before the select...
1
by: Philip Bondi | last post by:
Hello to all SQL Server junkies who work with non-English characters: For people running scripts from the command line using ANSI files with special characters, it is very important to use isql...
0
by: rbarry | last post by:
I have a stored procedure that contains a statement like: select @myvar = count(*) from mytable where mycolumn is null when I run the procedure from query analyser a value is set in @myvar...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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,...

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.