Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Powershell

Author  Topic 

dishant jain
Starting Member

5 Posts

Posted - 2014-06-25 : 03:13:11
Hi,

As we know there are two output windows in sql server management studio like 'Results' and 'Messages',
I want to capture that 'Messages' window into a log file using powershell program . like into a log file it should display like

ex:-
(1 row(s) affected)

(1 row(s) affected)


Can anyone help me out with this one

Dishant jain

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2014-06-25 : 17:55:35
Unless you work for Microsoft or otherwise have access to the API for SSMS you probably won't be able to do it. I tried with SQLCMD and couldn't find a way to get just the messages.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2014-06-26 : 01:40:51
@dishant jain - do you have to run the commands from SSMS , what about running them from Powershell?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

dishant jain
Starting Member

5 Posts

Posted - 2014-06-26 : 02:12:11
Actually i wrote a powershell program which is taking an input file containing some scripts, i want to capture message window of SSMS into a log file. How can i achieve that...

Dishant jain
Go to Top of Page

dishant jain
Starting Member

5 Posts

Posted - 2014-06-27 : 05:00:10
can any one help out with this...........

Dishant jain
Go to Top of Page

sardam98
Starting Member

10 Posts

Posted - 2014-06-29 : 03:47:40
goood

http://www.soran.edu.iq
Go to Top of Page
   

- Advertisement -