Inside a stored procedure (or other TSQL) I can suppress the “rows returned” output at the end of a result set using “SET NOCOUNT ON”. I’d like to be able to do the same with the column headings at the start of the result set. This only is an issue for me when logging, i.e. when generating details from the running of scheduled jobs and other processes. If the PRINT statement wasn’t so verbose in this context (see Connect 514944 “Closed Won’t Fix”) then it could be used instead of SELECT. I’d like my log output to look like thisJob 'DBA - DBCC Checkdb - Physical' : Step 1, 'DBCC Checkdb - Physical Only' : Began Executing 2013-03-07 22:30:00Database: AdventureWorks2012 - 22:30:00 - "DBCC CHECKDB ([AdventureWorks2012]) WITH TABLERESULTS, PHYSICAL_ONLY "DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] Database: Application_Registry_Service_DB_efe162c8b0ca4ceda16af544108c150d - 22:30:03 - "DBCC CHECKDB ([Application_Registry_Service_DB_efe162c8b0ca4ceda16af544108c150d]) WITH TABLERESULTS, PHYSICAL_ONLY "DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]…(three lines per database, of which one is blank). Instead it looks like thisJob 'DBA - DBCC Checkdb - Physical' : Step 1, 'DBCC Checkdb - Physical Only' : Began Executing 2013-03-07 22:30:00 - --------------------------------<this was too big for this field, so I've had to truncate it>See attached file for a fuller description/example.Proposed Solution:A “SET HEADING OFF” set option, or similar, within TSQL, similar to SET NOCOUNT ON
Product Language
Category
Proposed Solution
Primary Benefit
Other Benefits
Virtualization
Please wait...