473,394 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

[Sql2000] how to limit table size

hi all,
I checked out in google groups but was not able to find
the answer...
is it possible to limit size table in sql server?
how can I do it?

TIA
Aug 28 '06 #1
2 5570
ilkaos wrote:
hi all,
I checked out in google groups but was not able to find
the answer...
is it possible to limit size table in sql server?
how can I do it?

TIA
Add the table to some filegroup and then fix the total size of files in
that filegroup:

CREATE TABLE tbl
(... ) ON filegroup_xyz;

Take a look at ALTER DATABASE ... ADD FILEGROUP / FILE for more
details.

Alternatively, you could use constraints to limit the maximum number of
*rows* in a table (not necessarily comparable with the size of the
table in storage). The details of how to do this would depend on the
nature of the table and keys. For example:

/* Maximum 10,000 rows */
ALTER TABLE tbl ADD foo INT NOT NULL
CONSTRAINT ak_tbl_foo UNIQUE,
CONSTRAINT ck_tbl_foo CHECK (foo BETWEEN 1 AND 10000);

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--

Aug 28 '06 #2
>"David Portas" <RE****************************@acm.org>
thanks a lot for you (very quick!) answer.
Aug 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: LizP | last post by:
Hi, guys - looking for a bit of help/advice on moving a database from SQL 7 to SQL 2000. We've a third party application which currently uses a SQL7 database. This database has a number of views...
17
by: Gareth Tuckwell | last post by:
Does anyone if there is a limit on the number of fields or the number of tables in an Access97 database? My code suddenly won't compile after I have added a few fields in one table and I wonder...
2
by: steve | last post by:
I am setting up a huge database in mysql, and I get the above error in Linux. I believe it is related to the size of one of my tables, which is 4,294,966,772 bytes in size. Can someone help. How...
9
by: pheonix1t | last post by:
hello, I've been assigned to do performance tuning on an SQL2000 database (around 10GB in size, several instances). So far, I see a single RAID5 array, 4CPU (xeon 700MHZ), 4GB RAM. I see the...
7
by: johnm | last post by:
We have a new CRM application that uses a DB2 7.2 database. Our users noted that the CRM application would not allow them to attach and store any documents over 2 meg in size. When asked, the...
3
by: ken | last post by:
Hi, I was wondering how the 4k table record limit is counted. I have access 2k. I text fields are 256 chars. Memo fields are not included in the calculation. What about yes/no fields would that be...
10
by: VM | last post by:
How can I limit the use of the PC's virtual memory? I'm running a process that basically takes a txt file and loads it to a datatable. The problem is that the file is over 400,000 lines long (77...
7
by: jc | last post by:
Hello, a question for the MS Access community, from someone who programs with SQL in SQL2000. I currently create a table with varying column names and data within SQL2000. I then need to...
0
by: vineetcs | last post by:
Yes In SQL2000 , Row_Number() function will not work as in SQL2005. But, we can use the IDENTITY(INT,1,1) function but it requires a temporary table to which it stores the data and in View does'nt...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.