Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 using triggers for email address and room booking

Author  Topic 

sacko_ax
Starting Member

21 Posts

Posted - 2006-11-30 : 07:55:15
this is what i am looking for,

A client with an email address that does not end in uk cannot make a room booking

Any ideas

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2006-11-30 : 08:02:08
right(emailaddress, 2) <> 'UK'


Duane.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-30 : 08:02:20
Why do you need trigger for this? Column level CHECK constraint will serve your purpose.

CREATE TABLE ROOMS
(
COL1 ...
COL2 ...,
EMAIL VARCHAR(50) CHECK (EMAIL LIKE '%.UK')
)


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-11-30 : 08:11:03
"Why do you need trigger for this?"

I read it as a constraint on the ROOM_BOOKING table which joins to the CLIENT table (and needs to check the CLIENT.EMAIL_ADDRESS column)

Kristen
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-30 : 08:15:05
You can read between the lines, Kristen!

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

sacko_ax
Starting Member

21 Posts

Posted - 2006-11-30 : 08:18:17
anyone fancy doin it for me if i send you the source code
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2006-11-30 : 08:23:20
I'll do it - send you salary along with the source code to me.


Duane.
Go to Top of Page

sacko_ax
Starting Member

21 Posts

Posted - 2006-11-30 : 08:24:02
sounds like a plan if you ask me
how much
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2006-11-30 : 08:27:08
Just to clear things up, before people think that I am using this as an advertising medium.
I WAS JOKING - You know that Right?

Post the Table layout/s and sample data - and I'm sure that somebody can help/guide you.


Duane.
Go to Top of Page

sacko_ax
Starting Member

21 Posts

Posted - 2006-11-30 : 08:30:59
Think we know your jokin lol


Go to Top of Page
   

- Advertisement -