Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Reuse of space after truncating
Hi,

Will space used by an table be unallocated if the table is truncated or
will it only be marked as unused?

TIA,



Report this thread to moderator Post Follow-up to this message
Old Post
Gurba
03-31-06 08:23 AM


Re: Reuse of space after truncating
Can you explain the difference between unallocated and unused?

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/
Blog: http:// solidqualitylearning
.com/blogs/tibor/


"Gurba" <gurbao@hotmail.com> wrote in message
 news:Xns97976A2B37D0
 Fgurbaohotmailcom@12
9.250.171.66...
> Hi,
>
> Will space used by an table be unallocated if the table is truncated or
> will it only be marked as unused?
>
> TIA,
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
Tibor Karaszi
03-31-06 08:23 AM


Re: Reuse of space after truncating
Hi,

well,
as I have understood space allocation in SQL Server it will allocate 1
extent when needing more space for data (not talking about mixed extents
here). If the new data is only occupying 1 page in the extent the whole
extent is counted as allocated and 7 pages as unused.

Am I far off in my understanding this issue? If so, please explain...

TIA,

"Tibor Karaszi" <tibor_please.no. email_karaszi@hotmai
l.nomail.com> wrote
in news:OuSKkGKVGHA.196@TK2MSFTNGP10.phx.gbl:

> Can you explain the difference between unallocated and unused?
>


Report this thread to moderator Post Follow-up to this message
Old Post
Gurba
03-31-06 12:24 PM


Re: Reuse of space after truncating
Your understanding about pages and extent allocation seems to be correct. Wh
en you do TRUNCATE
TABLE, all the extents are deallocated for the table and its indexes. If you
 do it in a transaction,
the deallocated pages are not available for re-use until COMMIT. But essenti
ally, you end up with
the same situation as if you just had created the table (and indexes) and be
fore you insert the
first row into the table.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/
Blog: http:// solidqualitylearning
.com/blogs/tibor/


"Gurba" <gurbao@hotmail.com> wrote in message
 news:Xns9797852E1C29
 6gurbaohotmailcom@12
9.250.171.68...
> Hi,
>
> well,
> as I have understood space allocation in SQL Server it will allocate 1
> extent when needing more space for data (not talking about mixed extents
> here). If the new data is only occupying 1 page in the extent the whole
> extent is counted as allocated and 7 pages as unused.
>
> Am I far off in my understanding this issue? If so, please explain...
>
> TIA,
>
> "Tibor Karaszi" <tibor_please.no. email_karaszi@hotmai
l.nomail.com> wrote
> in news:OuSKkGKVGHA.196@TK2MSFTNGP10.phx.gbl:
> 
>


Report this thread to moderator Post Follow-up to this message
Old Post
Tibor Karaszi
03-31-06 12:24 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:25 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006