Can we restrict the number of maximum records inserted in a particular table?
-
hi everyone, I've a table in which the primary key needs to be a six digit number and must start from 1, so for that I made it an identity key (100001,1) but the problem is that I can't figure out how to restrict this to not exceed 199999 I'm using Sql Express 2005 as the Database. As far as I've seen while googling it out. There's no obvious way to do that. Can anyone comment on that plz? Thanks in advance
Rocky Success is a ladder which you can't climb with your hands in your pockets.
-
hi everyone, I've a table in which the primary key needs to be a six digit number and must start from 1, so for that I made it an identity key (100001,1) but the problem is that I can't figure out how to restrict this to not exceed 199999 I'm using Sql Express 2005 as the Database. As far as I've seen while googling it out. There's no obvious way to do that. Can anyone comment on that plz? Thanks in advance
Rocky Success is a ladder which you can't climb with your hands in your pockets.
-
oh yea, I just got this in mind a few minutes ago, Thanks:rose:
Rocky Success is a ladder which you can't climb with your hands in your pockets.
Seems like a design nightmare. What is going to happen when the data grows past that number? Also you are breaking the cardinal rule of record identifiers, you are assigning intelligence to the ID field. Next I suppose you are going to sort by the id field!
Never underestimate the power of human stupidity RAH
-
Seems like a design nightmare. What is going to happen when the data grows past that number? Also you are breaking the cardinal rule of record identifiers, you are assigning intelligence to the ID field. Next I suppose you are going to sort by the id field!
Never underestimate the power of human stupidity RAH
well I've asked almost the same question from the designers of the db but I'm still waiting for their response on this. But if they do insist I guess I'll have to say: As u say Mr. XXX :) Ur damn right:
Mycroft Holmes wrote:
Never underestimate the power of human stupidity
Rocky Success is a ladder which you can't climb with your hands in your pockets.
-
well I've asked almost the same question from the designers of the db but I'm still waiting for their response on this. But if they do insist I guess I'll have to say: As u say Mr. XXX :) Ur damn right:
Mycroft Holmes wrote:
Never underestimate the power of human stupidity
Rocky Success is a ladder which you can't climb with your hands in your pockets.
Rocky# wrote:
designers of the db
Oh - you don't own the design :-O , poor bugger, my sincere sympathies.
Never underestimate the power of human stupidity RAH
-
Rocky# wrote:
designers of the db
Oh - you don't own the design :-O , poor bugger, my sincere sympathies.
Never underestimate the power of human stupidity RAH
-
hi everyone, I've a table in which the primary key needs to be a six digit number and must start from 1, so for that I made it an identity key (100001,1) but the problem is that I can't figure out how to restrict this to not exceed 199999 I'm using Sql Express 2005 as the Database. As far as I've seen while googling it out. There's no obvious way to do that. Can anyone comment on that plz? Thanks in advance
Rocky Success is a ladder which you can't climb with your hands in your pockets.
i don´t know what you have in mind but if you trigger a SP to add data to one table, edit in that SP a if/else statement that counts the table records and; 1) add a record or 2) the display a error info message to the user. ;P