Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Raise an error anyone????
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00523901
Message ID:
00524178
Views:
13
Steven

You aren't really using raise error, but to follow what you are doing, try something like:
DECLARE @rows int

set @rows = (select count(progeddid) from progedd_pacid where progeddid is null)

if @rows > 0
  print @rows
else
  print 'none today'
If you truly want to raise an error, see John Barone's message.

BOb


>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
Previous
Reply
Map
View

Click here to load this message in the networking platform