?
Solved

SQLPLUS equivalent at t-sql

Posted on 2012-03-27
2
Medium Priority
?
1,425 Views
Last Modified: 2012-04-10
Hi,
i am running following SQL at ssms which goes OK but I am not able to save output in a file. I wish to run this SQL and spool results in single file. This does work under oracle using sqlplus.

I think I can use sqlCmd .
Does it provide any formatting options?
How to pass a t-sql stmt file "a.sql" to run at sqlcmd?

a.sql-----
exec sp_spaceused test1
exec sp_spaceused test2
exec sp_spaceused test3
----------
Thnaks
Microsoft-SQL-Server-Management-.gif
0
Comment
Question by:crazywolf2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
jogos earned 2000 total points
ID: 37772327
Indeed sqlcmd, it does not have the powerfull pormating options as sqlplus

sqlcmd -i inputfile -o outputfile -d dbname -U login -P pwd

The whole description
http://msdn.microsoft.com/en-us/library/ms162773.aspx
0
 
LVL 58

Expert Comment

by:HainKurt
ID: 37773388
sqlcmd: The newest, fanciest command-line interface to SQL Server.
isql : The older, DB-Library (native SQL Server protocol) way of command-line communication with SQL Server.
osql : The older, ODBC-based way of command-line communication with SQL Server.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question