473,668 Members | 2,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question About a Check Constraint

1 New Member
I am attempting to write a Check Constraint on an MSSQL2k server that will only allow a string to be INSERTED or UPDATED if it is formatted correctly.

The correct format being, that the first character is uppercase [A-Z], and any trailing characters [a-z] in the word are lowercase, unless there is a space. If there is a space, the next character after the space should be uppercase [A-Z], and any trailing characters in the word will be lowercase[a-z]. Punctuation should also be allowed.

I know a function can be written to make sure that when INSERTS and UPDATES are performed, that the strings are manipulated to conform to this requirement. The problem is that I am not going to be the person that writes these functions, and I was hoping to create this constraint as an extra level of verification, but I am not even sure that this is possible.

So now the questions:
1.) Is this possible
2.) Could someone write me an example.

Thanks in adance.
-John
Feb 18 '07 #1
1 1433
dorinbogdan
839 Recognized Expert Contributor
Did you find a solution? If not, do you need more?
Feb 20 '07 #2

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

Similar topics

4
2912
by: wireless | last post by:
I've written code that dynamically builds an sql query based on various constraint possibilities. The problem is the code would have been very complex had I not come up with a dummy constraint as a kind of place holder in the statement. To avoid complex logic that determines if there was another constraint before any other constraint and hence the need to add, say, AND or not, I came up with a dummy constraint so that every subsequent...
5
5289
by: Rob Panosh | last post by:
Hello, In MSS 2k can Primary Key, Unique Constraints, Indexes and Foreign Keys be disabled? If Indexes (PK's and UN Constraints) can be disabled what happens if data is inserted while disable? Will the index be rebuilt when enabled? Thanks, Rob Panosh
3
9061
by: RAD | last post by:
I am working with an evaluation copy of SQL Server 2000 for the first time; my DB experience lies with MS Access. I have a simple table in SQL Server (tblCompany) that has a field called "Ticker." When new company stock tickers (i.e., MSFT for Microsoft) are entered into the field, I'd like them in all caps--whether the user types msft, Msft, MsFt, etc. In Access, this was easy--simply set the Format to ">" in table design view. In...
17
1575
by: Dan Williams | last post by:
I am using Microsoft SQL Server 2000 and have a question about our database design. Here is a sublist of tables and columns we currently have:- Employee ---------- Ee_Code PRIMARY KEY Ee_Name NOT NULL
2
5756
by: DW | last post by:
Greetings: I have to do a one-off forceful change of some data in a database. I need to disable some FK constraints, make the data change, and then re-enable the constraints. My process will be: ALTER TABLE TABLE1 NOCHECK CONSTRAINT FK_TABLE1_TABLE2 UPDATE TABLE1 SET COLUMN1=2 WHERE COLUMN2='Problem row'
3
6317
by: ferg | last post by:
I have a Customer table. The table has two different CHECK constraints. Then there is the Customer details dialog, which provides the user with an UI for changing users. I have some UPDATE sql, which is called once the user clicks the OK button on this dialog. try { int rows = cmd.ExecuteNonQuery(); } catch(SqlException se)
3
1777
by: G. Miller | last post by:
Hey, I've got what seems like a simple question, but I've been wrestling around with it for way too long. I've got two fields in a table named and . I don't want the user to be able to enter a SPW (single piece weight) without entering the number of pages. Since Access doesn't allow me to compare table fields in the field validation rules (ie, ), I'm trying to do it in the table validation and according to everything I've read it's...
5
3839
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big table, we try separate this big table into twelve tables and create a view
5
598
by: Michael_Burgess | last post by:
Hi there, I'm fairly new to database design, having only really worked with existing tables etc in the past. Simple question this really........... In a users table, is it wise to have a ManagerID column that is effectively pointing to another user in the same table, with the theory being that if that person is top dog, they will just have a
9
1759
by: leebridgewater | last post by:
Hello Group, I'm new to SQL sever but I have managed to create a SQL based online application and I just have a question that I'm sure someone here will be able to help me with. I have a database setup and from within this database I would like to run a query to produce a simple report showing me the enquiry details along with the network the enquiry member is from.
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8575
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2784
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.