Limit amount of SQL information

Asked

Viewed 182 times

0

How can I limit the number of rows in my SQL table?(other than with limit in select, it’s not like query) ex. I have to have a maximum of 10 information in the table, but it is not limited, if 30 people register, the table will have 30 information instead of 10.

  • I couldn’t understand what you wanted LIMIT. You don’t want me to be made more than 10 inserts, that’s it?

  • 1

    I believe you can only do that with a Rigger Oninsert and setting rules for Count. Is your database filled in via the system? You can’t put this rule in the management before initiating the Insert?

  • What data bank are we talking about?

  • 1

    What is the purpose of limiting the amount of records a table can have?

1 answer

1

Natively this is not possible friend, I’ll give you 2 possible solutions.

To first you can create a trigger that checks the amount of records and after that makes the insertion in the database.

To second is you do the processing in your own application by performing the database search before performing the insertion.

Particularly in your situation I preferred the first option.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.