473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need Help, RaiseError, Check Constraint or Rules

Hi! Im new in this forum..

Obviously I need help,
Is there a way I can make a Custom Error Message using RaiseError statement?

This is the problem, I want an error message whenever a user break a rule or a check constraint. I know there's a system error message for that but I want it customize that a user will understand what the error was about. And I just want it in a particular Rule or Check Constraint not all..

Im just new in SQL so Please help me out.. A sample statement would be nice
I hope i made sense to you..
Mar 15 '08 #1
3 2664
oh Yea, Im using MS SQL 2000 in 2000Advance Server...

I actually have an idea but i can't put it into syntax..

My Idea is,,

I will create a RaiseError Message.. or something like that

then I will create a StoreProcedure that everytime user violates a check constraint or rule it will trigger/call the RaiseError i made..

is that possible??!!!
Mar 15 '08 #2
ck9663
2,878 Expert 2GB
use combinations of:

1. @@error

2. BEGIN TRY...END TRY BEGIN CATCH...END CATCH

3.RAISERERROR


Happy Coding

-- CK
Mar 15 '08 #3
use combinations of:

1. @@error

2. BEGIN TRY...END TRY BEGIN CATCH...END CATCH

3.RAISERERROR


Happy Coding

-- CK
@@error = 'msg ID' is that the one?

i never use try and catch before.. would you give me some sample syntax?
just one...
does it works in sql2000?

thanks man, appreciate it
Mar 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Doug Baroter | last post by:
Hi, DDL: -- create table #task (taskID int identity(1,1) primary key, taskName varchar(25) unique, taskCompleteDate dateTime, taskComplete bit default(0)); /* Business Rules: a) if...
8
by: Jason | last post by:
I have a table that matches up Securities and Exchanges. Individual securities can belong on multiple exchanges. One of the columns, named PrimaryExchangeFlag, indicates if a particular exchange is...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
9
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the...
6
by: Susanne Klemm | last post by:
Hi! I have a table with a check constraint. But unfortunately it does not work like I wanted. CREATE TABLE MAP ( NOT NULL, NULL,
22
by: pbd22 | last post by:
hi. I am having probelms with an update statement. every time i run it, "every" row updates, not just the one(s) intended. so, here is what i have. i have tried this with both AND and OR and...
0
by: halex | last post by:
Hello, I am having deadlock problem when I have a lot of visitors on my website at the same time. I am using NetTiers templates to generate C# classes for accessing DB layer and problem is in my...
12
by: Pietro Cerutti | last post by:
Dear all, I would like to open another topic to try to clarify a doubt raised on my previous post today with the subject 'printf("%d%d%d")'. Reading through the standard, I cannot find a clear...
3
by: moorcroft | last post by:
Hi I am trying to write some sql to because we have a missing foregin key constraint. The following is what I have been asked to do: 1. COMPULSORY_WORK.reference to LISTED_BUILDING.reference ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.