I've got a procedure like this..

Code:
CREATE PROC dbWBS_sp_ExecuteQuery
(
	@QueryString		VARCHAR(8192),
	@ErrMsg				VARCHAR(512) OUTPUT
)
AS	
BEGIN	
	EXEC @QueryString
END
Now if there is any error in the querystring I want to store that error message in this variable @ErrMsg. How can I accompalish this??

Thanks in Advance