I want to declare a VARCHAR
variable in MSSQL that can hold this
set @RaiseErrorMessage =
('ErrorNumber='+(cast((select ERROR_NUMBER()) as varchar(100)))+
,ErrorSeverity='+ (cast((select ERROR_SEVERITY()) as varchar(100)))+
',ErrorState='+(cast((select ERROR_STATE()) as varchar(100)))+
',ErrorLine='+(cast((select ERROR_LINE()) as varchar(100)))+
,ErrorMessage='+(cast((select ERROR_MESSAGE()) as varchar(100))))
How should the declaration look for an variable like this? I tried
declare @RaiseErrorMessage varchar
but it didn't help.