Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Custom Error message

This is a discussion on Custom Error message within the SQL Server forums, part of the Databases category; What would you use to place a not null constraint on a column? If the column is left blank on insertion, it should display a custom error message. 1. Rule ...

Go Back   Geeks Talk > Databases > SQL Server
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

SQL Server SQL Server is a Database Management System(DBMS) by Microsoft

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2007
Junior Member
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jmanivannan is on a distinguished road
Custom Error message

What would you use to place a not null constraint on a column? If the column is left blank on insertion, it should display a custom error message.

1. Rule
2. CHECK Contstraint
3. Triggers
4. Alter the table so that the column does not allow null
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-16-2007
Junior Member
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jmanivannan is on a distinguished road
Re: Custom Error message

What would you use to place a not null constraint on a column? If the column is left blank on insertion, it should display a custom error message.

1. Rule
2. CHECK Contstraint
3. Triggers
4. Alter the table so that the column does not allow null[/QUOTE]
Reply With Quote
  #3 (permalink)  
Old 10-17-2007
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,853
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: Custom Error message

The best thing to do is to add a NOT NULL constraint on the column.
Reply With Quote
  #4 (permalink)  
Old 10-22-2007
Junior Member
 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
musonic is on a distinguished road
Re: Custom Error message

debasisdas,

How do you then display a custom error message?

If you check for null in a trigger you can raise it with raiseerror(), though not sure if it is the best way to do that.
Reply With Quote
Reply

  Geeks Talk > Databases > SQL Server

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Error message 1628: Failed to complete installation Geek_Guest QTP 0 09-25-2007 01:33 PM
Want to include our own error message rashmi_hr SAP R/3 0 09-24-2007 07:43 PM
Custom web objects Geek_Guest SilkTest 0 07-02-2007 10:17 PM
Repository shows an error message when opened in designer Geek_Guest Data Warehousing 1 06-28-2007 05:09 AM
How to capture text from message/error popup window Geek_Guest WinRunner 0 04-03-2007 02:25 PM


All times are GMT -4. The time now is 03:18 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved