some knows if osql (or isql) works well with SQL Server 6.5
Hi,
ISQL will work with SQL 6.5.
OSQL will not work with SQL 6.5, it works only with the newer versions.
Thanks
Hari
MCDBA
"Pablo Garateguy" <anonymous@.discussions.microsoft.com> wrote in message
news:B5B8DC9E-1D10-4D71-B0D8-16507FC85921@.microsoft.com...
> some knows if osql (or isql) works well with SQL Server 6.5
|||Hari,
have you tested this? It would seem that osql should work with SQL Server
6.5. It is just an ODBC application and as such should work as any other
ODBC application would work.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||Hi,
Excution I agree. OSQL will work with SQL 6.5
But OSQL utlity is only coming along with newer version. SQL 6.5
installation will not have an OSQL.
That is what I meant.
Thanks
Hari
MCDBA
"Rand Boyd [MSFT]" <rboyd@.onlinemicrosoft.com> wrote in message
news:D0M9fAmQEHA.796@.cpmsftngxa10.phx.gbl...
> Hari,
> have you tested this? It would seem that osql should work with SQL Server
> 6.5. It is just an ODBC application and as such should work as any other
> ODBC application would work.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.
>
Showing posts with label isql. Show all posts
Showing posts with label isql. Show all posts
Monday, March 12, 2012
Wednesday, March 7, 2012
osql or isql to run a batch remotely
Hello,
I have a collection of SQL Scripts that I would like to execute using a
batch file from a remote machine. Does anyone have any suggestions? I
think that I could use osql or isql, but I have never done that before. I
would appreciate any assistance.
Stewart
Stewart Saathoff wrote:
> Hello,
> I have a collection of SQL Scripts that I would like to execute using
> a batch file from a remote machine. Does anyone have any
> suggestions? I think that I could use osql or isql, but I have never
> done that before. I would appreciate any assistance.
> Stewart
I'm unclear about what is where...
Where is the file you want to execute located?
Do you want to run this file from a remote client or do you want to run
the file as though it were running directly on the server?
You can kick off OSQL from a stored procedure or a SQL Agent job on the
server. You could kick off OSQL from a client PC and execute a script
file that resides on the client PC. I would say that if the script file
is large, you'll get better performance running it from the server.
David Gugick
Imceda Software
www.imceda.com
|||ok, Let me be more clear.
I have a very large SQL Statement that needs to be run on the server.
Ideally the client will sit on their workstation and double-click on a file.
That file should execute the SQL statement on the server. I am pretty
positive that I can do all of this using osql, however I am unclear how I
can do this using a batch file. I don't want the users to have to type a
considerable amount and I definately do not want them to have to learn osql
or sql commands to do this...
Stewart
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:%237j3Oby1EHA.524@.TK2MSFTNGP09.phx.gbl...
> Stewart Saathoff wrote:
> I'm unclear about what is where...
> Where is the file you want to execute located?
> Do you want to run this file from a remote client or do you want to run
> the file as though it were running directly on the server?
> You can kick off OSQL from a stored procedure or a SQL Agent job on the
> server. You could kick off OSQL from a client PC and execute a script file
> that resides on the client PC. I would say that if the script file is
> large, you'll get better performance running it from the server.
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
|||Stewart Saathoff wrote:
> ok, Let me be more clear.
> I have a very large SQL Statement that needs to be run on the server.
> Ideally the client will sit on their workstation and double-click on
> a file. That file should execute the SQL statement on the server. I
> am pretty positive that I can do all of this using osql, however I am
> unclear how I can do this using a batch file. I don't want the users
> to have to type a considerable amount and I definately do not want
> them to have to learn osql or sql commands to do this...
> Stewart
>
If you have to run the SQL batch from a client PC, you can use OSQL.
There's an option for submitting a file to run. The command-line
interface is fairly straightforward and documented in BOL.
David Gugick
Imceda Software
www.imceda.com
|||<snip>
> I am pretty positive that I can do all of this using
> osql, however I am unclear how I can do this using a
> batch file.
<snip>
Stewart,
Assuming you get this to work at the command prompt...
osql -SBigBox -Uuser -Ppwd -ddbname -i somefile.sql -o somefile.log
You can just paste it into a BAT file: that's it. You can use @.ECHO OFF,
print out message, etc to pretty it up but that's pretty much all you need.
You would need a file with your SQL statement where the BAT file runs
(ideally the same folder). If that's not acceptable, then you could put the
statement in a stored proc and call the proc by name instead of using the
input file.
Craig
|||Thank you all for your help. Everything works great.
"Craig Kelly" <cnkelly.nospam@.nospam.net> wrote in message
news:yY9rd.1007069$Gx4.741632@.bgtnsc04-news.ops.worldnet.att.net...
> <snip>
>
> <snip>
> Stewart,
> Assuming you get this to work at the command prompt...
> osql -SBigBox -Uuser -Ppwd -ddbname -i somefile.sql -o somefile.log
> You can just paste it into a BAT file: that's it. You can use @.ECHO OFF,
> print out message, etc to pretty it up but that's pretty much all you
> need.
> You would need a file with your SQL statement where the BAT file runs
> (ideally the same folder). If that's not acceptable, then you could put
> the statement in a stored proc and call the proc by name instead of using
> the input file.
> Craig
>
I have a collection of SQL Scripts that I would like to execute using a
batch file from a remote machine. Does anyone have any suggestions? I
think that I could use osql or isql, but I have never done that before. I
would appreciate any assistance.
Stewart
Stewart Saathoff wrote:
> Hello,
> I have a collection of SQL Scripts that I would like to execute using
> a batch file from a remote machine. Does anyone have any
> suggestions? I think that I could use osql or isql, but I have never
> done that before. I would appreciate any assistance.
> Stewart
I'm unclear about what is where...
Where is the file you want to execute located?
Do you want to run this file from a remote client or do you want to run
the file as though it were running directly on the server?
You can kick off OSQL from a stored procedure or a SQL Agent job on the
server. You could kick off OSQL from a client PC and execute a script
file that resides on the client PC. I would say that if the script file
is large, you'll get better performance running it from the server.
David Gugick
Imceda Software
www.imceda.com
|||ok, Let me be more clear.
I have a very large SQL Statement that needs to be run on the server.
Ideally the client will sit on their workstation and double-click on a file.
That file should execute the SQL statement on the server. I am pretty
positive that I can do all of this using osql, however I am unclear how I
can do this using a batch file. I don't want the users to have to type a
considerable amount and I definately do not want them to have to learn osql
or sql commands to do this...
Stewart
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:%237j3Oby1EHA.524@.TK2MSFTNGP09.phx.gbl...
> Stewart Saathoff wrote:
> I'm unclear about what is where...
> Where is the file you want to execute located?
> Do you want to run this file from a remote client or do you want to run
> the file as though it were running directly on the server?
> You can kick off OSQL from a stored procedure or a SQL Agent job on the
> server. You could kick off OSQL from a client PC and execute a script file
> that resides on the client PC. I would say that if the script file is
> large, you'll get better performance running it from the server.
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
|||Stewart Saathoff wrote:
> ok, Let me be more clear.
> I have a very large SQL Statement that needs to be run on the server.
> Ideally the client will sit on their workstation and double-click on
> a file. That file should execute the SQL statement on the server. I
> am pretty positive that I can do all of this using osql, however I am
> unclear how I can do this using a batch file. I don't want the users
> to have to type a considerable amount and I definately do not want
> them to have to learn osql or sql commands to do this...
> Stewart
>
If you have to run the SQL batch from a client PC, you can use OSQL.
There's an option for submitting a file to run. The command-line
interface is fairly straightforward and documented in BOL.
David Gugick
Imceda Software
www.imceda.com
|||<snip>
> I am pretty positive that I can do all of this using
> osql, however I am unclear how I can do this using a
> batch file.
<snip>
Stewart,
Assuming you get this to work at the command prompt...
osql -SBigBox -Uuser -Ppwd -ddbname -i somefile.sql -o somefile.log
You can just paste it into a BAT file: that's it. You can use @.ECHO OFF,
print out message, etc to pretty it up but that's pretty much all you need.
You would need a file with your SQL statement where the BAT file runs
(ideally the same folder). If that's not acceptable, then you could put the
statement in a stored proc and call the proc by name instead of using the
input file.
Craig
|||Thank you all for your help. Everything works great.
"Craig Kelly" <cnkelly.nospam@.nospam.net> wrote in message
news:yY9rd.1007069$Gx4.741632@.bgtnsc04-news.ops.worldnet.att.net...
> <snip>
>
> <snip>
> Stewart,
> Assuming you get this to work at the command prompt...
> osql -SBigBox -Uuser -Ppwd -ddbname -i somefile.sql -o somefile.log
> You can just paste it into a BAT file: that's it. You can use @.ECHO OFF,
> print out message, etc to pretty it up but that's pretty much all you
> need.
> You would need a file with your SQL statement where the BAT file runs
> (ideally the same folder). If that's not acceptable, then you could put
> the statement in a stored proc and call the proc by name instead of using
> the input file.
> Craig
>
osql or isql
Guys:
Im new in MS SQL and I have little experienco on IBM DB2. I want to run a simple select query on a table, but I want to do it automatically... What do you recommend?? Where I can get information about OSQL or ISQL usage??'
Best regards,What do you mean 'automatically'? You can create stored procedure and run it from Quiry Analyzer by name. You can define parameters for selection criteria. Go to Online Help or Transact SQL help in Query Analyzer.|||for example in Unix you have the cron option. Means that I create the *.sql script and I schedulle it to run at certain time|||You can use SQL Server Agent.
Good luck.|||Go to Job Scheduling in Tools, Enterprise Manager. Use Create Job Wizard. Good luck.|||by the way, the query I use is very simple, select * from MEMBERS where MEM_ENTERED between '2002-05-06 00:00:00' and '2002-05-06 23:59:59'
I need to use change the date everyday. It is posible or exist the value = current date / current time in MS SQL to avoid changind date/ time everyday..
Regards|||Try this:
SELECT * from MEMBERS
where convert(char(10),mem_entered, 101)
= convert(char(10),getdate(),101)
You retrieve all the records entered for the day.
Good luck|||Thanks It works.
Just one question more. With that query I can get data for the current date. How I could change it to get for the previous day ??
In IBM DB2 I just made the date variable equal to current date - 1 day.
I will appreciate it|||Use getdate()-1 instead of getdate()- current date|||Thanks !!
It works. I will put it as schedulled job.|||I schedulled the job. But How I see the results?? Does it sends it to a log file??|||jeremas, is your goal is to run a sql script based on a cron job and dump the results to a text file?|||Thanks. I already found the way to run the query, schedule it and sending the results to a txt file. It was using the SQL Server Agent and job scheduling and properties.
Regards,
Im new in MS SQL and I have little experienco on IBM DB2. I want to run a simple select query on a table, but I want to do it automatically... What do you recommend?? Where I can get information about OSQL or ISQL usage??'
Best regards,What do you mean 'automatically'? You can create stored procedure and run it from Quiry Analyzer by name. You can define parameters for selection criteria. Go to Online Help or Transact SQL help in Query Analyzer.|||for example in Unix you have the cron option. Means that I create the *.sql script and I schedulle it to run at certain time|||You can use SQL Server Agent.
Good luck.|||Go to Job Scheduling in Tools, Enterprise Manager. Use Create Job Wizard. Good luck.|||by the way, the query I use is very simple, select * from MEMBERS where MEM_ENTERED between '2002-05-06 00:00:00' and '2002-05-06 23:59:59'
I need to use change the date everyday. It is posible or exist the value = current date / current time in MS SQL to avoid changind date/ time everyday..
Regards|||Try this:
SELECT * from MEMBERS
where convert(char(10),mem_entered, 101)
= convert(char(10),getdate(),101)
You retrieve all the records entered for the day.
Good luck|||Thanks It works.
Just one question more. With that query I can get data for the current date. How I could change it to get for the previous day ??
In IBM DB2 I just made the date variable equal to current date - 1 day.
I will appreciate it|||Use getdate()-1 instead of getdate()- current date|||Thanks !!
It works. I will put it as schedulled job.|||I schedulled the job. But How I see the results?? Does it sends it to a log file??|||jeremas, is your goal is to run a sql script based on a cron job and dump the results to a text file?|||Thanks. I already found the way to run the query, schedule it and sending the results to a txt file. It was using the SQL Server Agent and job scheduling and properties.
Regards,
Subscribe to:
Posts (Atom)