osql to connect to a Database

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Manzoorul Hassan (manzoorul.hassan_at_gmail.com)
Date: 01/06/05


Date: 6 Jan 2005 15:05:24 -0800

I am running MSDE 2000 Rel A on a Windows XP machine and am able to
connect to it by doing the following:

osql -U sa

or

osql -E

But how do I connect to a Particular Database or see all the tables
etc? I am a but familiar with sql (which could be the problem) and an
trying to do the following that I can with it:

sql user_name/database_name@password

so that I can connect directly to the DB I'm interested and then I can
do:

select tablenames;
desc table_name;
select * from table_name;
etc

Any ideas? Like I mentioned, maybe I'm trying to do things that is not
supposed to be possible with osql (which would really suck).

- manzoor



Relevant Pages

  • Re: osql in a cmd file, with SQL statements coming from the same cmd f
    ... Instead of having the SQL ... > want to have the SQL statements right there in the command file. ... > about instead of separate cmd and sql files. ... > Any way to do this with OSQL, ...
    (microsoft.public.sqlserver.tools)
  • Re: Cannot get OSQL line to work for SharePoint
    ... I'm sure other people have moved their SharePoint files from one drive to ... And do you need the OSQL command to execute automatically and quit? ... Because you can use it as an interactive query tool too, which might be easier for you to work with. ... then you enter a "go" statement to submit the query to SQL Server: ...
    (microsoft.public.windows.server.sbs)
  • Re: Can you use osql in DTS?
    ... Don't know if I mentioned it, but I am on SQL 7. ... > DTS can use Dynamic Properties tasks. ... > Can the osql be used in DTS? ... > @chartime into a stored procedure that I would call. ...
    (microsoft.public.sqlserver.dts)
  • Re: Can you use osql in DTS?
    ... Don't know if I mentioned it, but I am on SQL 7. ... > DTS can use Dynamic Properties tasks. ... > Can the osql be used in DTS? ... > @chartime into a stored procedure that I would call. ...
    (microsoft.public.sqlserver.programming)
  • Re: execute a sql file
    ... > beside ISQLW, OSQL, and ISQL utilities, ... ISQL sucks! ... OSQL is better than ISQL, ... But if your SQL is slow, then the tools are not making it any ...
    (microsoft.public.sqlserver.programming)