If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > Perl connecting to MS SQL server.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-05, 14:07
rumcho rumcho is offline
Registered User
 
Join Date: Mar 2005
Posts: 2
Perl connecting to MS SQL server.

I was wondering if there is a command-line utility that would connect to MS SQL server and would work just like MySQL client for unix?
If anyone knows could you please give us a link?
Also, a lot of those clients you just "get in" them and you can't really use the output to redirect to a file or pipe it through grep. Such utilities are quite "human-driven" and it would be nice if I could have a utility where I could pass to to it something like "Select * from customers" and then to pipe the output and then do something else with it and then trigger a process, etc.
As a side note I am missing this a lot especially using ncftp. Sometimes while working with it I need to put ncftp in the background so I can do something on the local filesystem before I could get back to it, or I need to save the output of the "ls -al" command to a local file or something like that.
Is this possible with the current utilities like mysql-client or ncftp? If not, such tool can be written pretty easily with perl - does anyone know of one?
Greets,
Roumen Semov
Reply With Quote
  #2 (permalink)  
Old 03-01-05, 14:36
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,613
For MS-SQL 7.0 and later, OSQL.EXE works nicely. For versions up to 7.0, ISQL.EXE is what you want.

Assuming you have MDAC_TYP.EXE installed to give you the necessary drivers, you can even do this without even using an executable.

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On