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