Solved

SQLPLUS equivalent at t-sql

Posted on 2012-03-27
2
1,269 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
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.
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

20 Experts available now in Live!

Get 1:1 Help Now