About 14,200,000 results
Open links in new tab
  1. Output SQL messages to a Log File - Stack Overflow

    Is there a way to send the messages generated from executing these commands to a simple log file e.g "C:\log.txt"? The messages I mean are the ones that appear in the messages box at the bottom of SQL Server 2005 Management Studio after a query has executed.

  2. How to route SQL print output to log file? - Stack Overflow

    May 11, 2016 · Invoke-SqlCmd implements T-SQL PRINT statements and RAISERROR using the verbose parameter. To capture verbose output, first you'll need to include the parameter in your call to invoke-sqlcmd i.e. invoke-sqlcmd -verbose and next you can do one of two things:

  3. logging detailed information to file in SQL Server

    Sep 6, 2011 · Does anyone have some code to simply log some detailed information to a file within a SQL query (or stored procedure or trigger)? I'm not looking for anything fancy. All I want to do is to quickly put debug information into my SQL, …

  4. How to write the output of "print" messages to a file - path (c:test ...

    Aug 4, 2011 · Given a proper file name and message, write the message to the file name. The file will be. created if it doesn't exist. Usage: EXEC @Return = dbo.WriteLineToFile @pFullPath, @pMessage;

  5. Open Log File Viewer - SQL Server | Microsoft Learn

    Feb 28, 2023 · Beginning in SQL Server 2012 (11.x), you can use Registered Servers to view SQL Server log files from local or remote instances of SQL Server. By using Registered Servers, you can view the log files when the instances are either online or offline.

  6. Sql Server Procedure to Write Log into a File

    Jul 7, 2015 · Here I propose a simple stored procedure for Sql Server that allows you to do that, using it instead of the classic "print" to dbms console. Here is the stored procedure that do the work. Just copy and execute the code to create it: SET NOCOUNT ON; declare. @base_path as nvarchar(1000) = 'C:\sqlserver_logs\', @filename as nvarchar(1000) = 'mylog',

  7. sql server - Get detailed output of SQL Agent job - Database ...

    The SQL "Log File Viewer" (job history) has a "Selected row details" pane further down, but may need to be expanded or scrolled to see the full message. While viewing the job history in SSMS, In the right panel, "Log file summary", expand the date of the job failure.

    Missing:

    • Print

    Must include:

  8. sql server - How to print results in SQLcmd window - Database ...

    Dec 2, 2019 · If you want results to go to a file and messages to go to the screen (and not into the file), then you cannot use the -o switch. Instead, you will need to manually redirect output (i.e. "stdout") to the file using > on the command line, as in > log.xls .

  9. Stored Procedure print to log file. – SQLServerCentral Forums

    May 1, 2009 · I want to write to a log file or the SQL Agent history from within my stored procedure. If I had a simple SSIS package that executes an SQL task that called a stored procedure.

  10. How to Read Log File in SQL Server using TSQL

    Feb 24, 2022 · SQL Server offers an undocumented system stored procedure sp_readerrorlog. This SP allows you to read the contents of the SQL Server error log files directly from a query …

    Missing:

    • Print

    Must include:

  11. Some results have been removed