Previous Topic

Next Topic

Inhoudsopgave

Book Index

Raiserror

The syntax between ASE and MS SQL Server differs. Also, the user defined messages in ASE start at error_nr 20,000, whereas in MS SQL Server they start at error_nr 50,001.

raiserror error_nr [{‘error_string’ | @variable}]

[, argument [,...n]]

raiserror ({error_nr | ‘error_string’ | @variable}

{, severity, state}

[, argument [,...n]])

[with option [,...n]]

Example ASE

declare @Message varchar(50)

set @Message = 'error while inserting a record into table %1!'

raiserror 20000 @Message, 'T_Country'

Example MS SQL Server

declare @Message varchar(50)

set @Message = 'error while inserting a record into table %s'

raiserror (@Message, 10, 1, 'T_Country')