Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Raise an error anyone????
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00523901
Message ID:
00523928
Vues:
13
Try:
RAISERROR('Description of my custom error', 16, 1)
Where 'Description of my custom error' = text you want to see
16 = Severity level of your custom error (16 is usually used for user-defined errors like yours)
1 = State variable (Doesn't matter to SQL Server what you pick...)

BOL (Books Online -- SQL Server help) has more on this in case you need to know more...

John Barone


>Yep I want to raise an error. I want to have the system notify me of an error condition if I have NULL values in a table.
>
>Here is test code that I have been playing with for the past few hours:
>
>
>DECLARE @rows int
>--if (
>select progeddid
>from progedd_pacid
>where progeddid is null
>--)
>--begin
>
>Select @rows = @@ROWCOUNT
>
>if (@rows > 0 )
>
>I want the error to occur here
>
>print @rows
>else
>print 'none today'
>--end
>
>I've tried the if / if exist and still don't have a good return that I can test except for this.
>
>If there are nulls, that means a table was down in DTS import into our DW and I need to know before a user tells me....
>
>TIA
>
>__Stephen
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform