Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to restrict a table size while creating table?

Author  Topic 

rafeequddin_ahmed
Starting Member

23 Posts

Posted - 2006-10-01 : 13:30:47
HI,
this is the first question from me to this forum hope i will answer?

How can i restrict a table while creating to particular size like(200 Mb)
and also can we applying the same restriction to a particular column?

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-10-01 : 22:26:36
You can restrict the size of a table by creating it in a filegroup by iyself and restricting the total size of the files in that filegroup.

I'm not sure what you mean by restricting the size of a column. Please explain what you want to do.



CODO ERGO SUM
Go to Top of Page

rafeequddin_ahmed
Starting Member

23 Posts

Posted - 2006-10-02 : 00:51:37
quote:
Originally posted by Michael Valentine Jones

You can restrict the size of a table by creating it in a filegroup by iyself and restricting the total size of the files in that filegroup.

I'm not sure what you mean by restricting the size of a column. Please explain what you want to do.

will u plz shoe me the step or code for restricting a table size,
Thanks in advanced

CODO ERGO SUM

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-10-02 : 08:45:36
Can't think of a way to restrict the size of a column, but you can have an "alert" on its total size:

SELECT SUM(DATALENGTH(MyColumn))
FROM MyTable

If your column is UniCode watch out for whether you are counting Characters or Bytes!!

I think DATALENGTH(MyColumn) counts trailing spaces and LEN(MyColumn) does not - but you'd need to check that too, depending on your requirements

Kristen
Go to Top of Page
   

- Advertisement -