Solved

SQLPLUS equivalent at t-sql

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 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