![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Write "Messages" window to a log file?
Is there a way to write the information that appears in the "Messages"
window in SQL Server Management Studio to an external log file? I'd like to keep a record of these logs as I run each script once a month and it would be useful to compare run times for each step. We have several places where we insert variations of the following code along the way which gives us a snapshot of how long a particular step took: SET @Msg = '[STEP 1] - Starting - __GlobalDeleteNonClusteredIndexes '+ CONVERT(varchar(20),GETDATE(),101)+' '+ CONVERT(varchar(20),GETDATE(),108) RAISERROR(@Msg, 0, 1) WITH NOWAIT Any help is appreciated. |
|
|||
|
Re: Write "Messages" window to a log file?
Hermes (manningfan@gmail.com) writes:
> Is there a way to write the information that appears in the "Messages" > window in SQL Server Management Studio to an external log file? I'd > like to keep a record of these logs as I run each script once a month > and it would be useful to compare run times for each step. We have > several places where we insert variations of the following code along > the way which gives us a snapshot of how long a particular step took: > > SET @Msg = '[STEP 1] - Starting - __GlobalDeleteNonClusteredIndexes > '+ > CONVERT(varchar(20),GETDATE(),101)+' '+ > CONVERT(varchar(20),GETDATE(),108) > > RAISERROR(@Msg, 0, 1) WITH NOWAIT > > Any help is appreciated. Try View->Results->To File from the menu. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|