30 pts.
 How to Make Fixed Row Table
Hi all My question is that i want to make the table which will accept only 500 row. even it could not accept 501th row. i mean to say i can't accept at the time of insertion not on fetch time

Software/Hardware used:
sql server 2008
ASKED: May 12, 2010  7:35 AM
UPDATED: May 13, 2010  7:42 AM

Answer Wiki:
You could use a CHECK constraint. Semething like this: <pre>CREATE FUNCTION CheckFnctn() RETURNS int AS BEGIN DECLARE @retval int SELECT @retval = COUNT(*) FROM yourTable RETURN @retval END; GO ALTER TABLE yourTable ADD CONSTRAINT chkRowCount CHECK (dbo.CheckFnctn() <= 500 ); GO</pre> -CarlosDL
Last Wiki Answer Submitted:  May 12, 2010  3:47 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thank it is Working U r the Mind Blowing Man

I want to give u a complement :

I want to be like u if u help me

tanks…………………………….
my id is : “computerboy8603@yahoo.com”
this is not a big metter but i want to apriciate ur creativity

 30 pts.