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
 error message is truncated

Author  Topic 

jefals
Starting Member

8 Posts

Posted - 2011-04-28 : 22:53:03
Hello:

In my results pane, after a Try/Catch test, I should see the whole message below, but I'm only seeing the part in red... The messasge is inside a rectangular box that's only big enough to hold the red part...What's going on?
Thanks,
Jeff
An error has occurred at line 4 with error 245 Conversion failed when converting the varchar value 'Not Right' to data type int.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-29 : 08:21:26
Is this from management studio?
What are you doing in the catch blocK and are you sure it's raised by this?
Try displaying the results in text (ctl T).

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2011-04-29 : 10:15:14
In "grid mode" raised errors will show in the Messages tab. Looks to me like you caught this error and simply SELECTed the error text which would cause it to disply in the Results tab. You can drag the column wider to see the entire message, or you can put the results in text mode (as nigel said) or you can actually RAISERROR which will show in full on the message tab.

Be One with the Optimizer
TG
Go to Top of Page

jefals
Starting Member

8 Posts

Posted - 2011-04-29 : 21:43:24
Is this from management studio?
What are you doing in the catch blocK and are you sure it's raised by this?
Try displaying the results in text (ctl T).

Yes, from mgt. studio. Here is the whole thing...
declare @probs int
begin try
select @probs='Not right'
end try
begin catch
select 'an error has occurred at line ' +
LTRIM(str(error_line())) +
' with error ' + LTRIM(str(error_number())) + ' ' + ERROR_MESSAGE()
end catch
Go to Top of Page

jefals
Starting Member

8 Posts

Posted - 2011-04-29 : 21:46:35
Text mode works...In grid mode, I can't seem to drag to box any wider...
Go to Top of Page
   

- Advertisement -