Hi,
Currently squirrel's Error Output looks somewhat like this:
Error: Incorrect syntax near the keyword 'as'.
SQLState: S0001
ErrorCode: 156
This feature request asks for the line number of the error to be added to it.
One of the few reasons to drop back to SSMS is that I can double click the error message and it will take me to exactly what caused the error.
It'd be great to at least see the line number in Squirrel. SQL server has "ERROR_LINE()" to output this.
Its possible its only relevant within the scope of running a full script vs a segment, but even within a segment of code it gives you a relative idea of where the error happened.
If curious how it works, the function I currently use to see error output looks something like this:
ALTER FUNCTION [dbo].[fn_FormatErrorOutput]()
RETURNS nvarchar(MAX)
AS
BEGIN
declare @OutMsg VARCHAR(MAX) =
isnull('Error:' + CHAR(9) + ERROR_MESSAGE() + CHAR(10), '')
+ isnull('SQLState:' + CHAR(9) + format(ERROR_STATE(), 'S000#') + CHAR(10), '')
+ isnull('ErrorCode:' + CHAR(9) + rtrim(ltrim(str(ERROR_NUMBER()))) + CHAR(10), '')
+ isnull('ErrorLine:' + CHAR(9) + rtrim(ltrim(str(ERROR_LINE()))) + CHAR(10), '')
+ isnull('Severity:' + CHAR(9) + rtrim(ltrim(str(ERROR_SEVERITY()))) + CHAR(10), '')
+ isnull('Procedure:' + CHAR(9) + ERROR_PROCEDURE() + CHAR(10), '')
return @OutMsg
END