If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Reducing table space

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-11, 06:53
lodha13 lodha13 is offline
Registered User
 
Join Date: Apr 2010
Posts: 10
Reducing table space

Hi

I have a requirement in which i have to make a table full so that no further records can be inserted into it.

I can reduce the table space also.
can someone tell me either how to reduce the tablespace or somehow fill the table completely (no manually) so that no further inserts are possible

Thanks
Abhishek
Reply With Quote
  #2 (permalink)  
Old 10-20-11, 07:17
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
set the auto_increment of one of the rows to its maximum value
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-20-11, 07:46
lodha13 lodha13 is offline
Registered User
 
Join Date: Apr 2010
Posts: 10
alter table <tablename> auto_increment =222300

is this correct
Reply With Quote
  #4 (permalink)  
Old 10-20-11, 08:06
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
that should do it, except when i said "maximum" i meant the largest possible value for your auto_increment, not the largest value it currently has
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 10-20-11, 08:08
lodha13 lodha13 is offline
Registered User
 
Join Date: Apr 2010
Posts: 10
If i understood correctly this is the maximum number of rows that can be inserted right?

Its is taking a lot of time
more than 30 min and still not done.
Reply With Quote
  #6 (permalink)  
Old 10-24-11, 06:39
ankur02018 ankur02018 is offline
Registered User
 
Join Date: Jun 2007
Posts: 189
First Be clear what you have to do Reduce table space or limit max table

What engine is table using ?
Reply With Quote
  #7 (permalink)  
Old 10-25-11, 06:40
lodha13 lodha13 is offline
Registered User
 
Join Date: Apr 2010
Posts: 10
I want a situation in which no new row can be inserted into the a table
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On