Solved

SQLPLUS equivalent at t-sql

Posted on 2012-03-27
2
1,285 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
2 Comments
 
LVL 25

Accepted Solution

by:
jogos earned 500 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 51

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now