[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQLPLUS equivalent at t-sql

Posted on 2012-03-27
2
Medium Priority
?
1,497 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 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 61

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

829 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