SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Delete rows in SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jazz1974
Starting Member

1 Posts

Posted - 04/23/2013 :  04:25:14  Show Profile  Reply with Quote
I delete rows in Table on SQL . I use command "DELETE "name of table" ". after this command, SQl deleted these rows, but size of DB not changed in Hard Disk. I think programms selected these how deleted. How i can dlete phisical rows without command "DROP Table."
Thanks.

bandi
Flowing Fount of Yak Knowledge

India
2217 Posts

Posted - 04/23/2013 :  05:48:39  Show Profile  Reply with Quote
Use TRUNCATE statement if you want to delete all the rows... TRUNCATE will releases memory back

--
Chandu
Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8765 Posts

Posted - 04/23/2013 :  07:06:30  Show Profile  Visit webfred's Homepage  Reply with Quote
quote:
Originally posted by bandi

Use TRUNCATE statement if you want to delete all the rows... TRUNCATE will releases memory back

--
Chandu


I believe that truncate table will release space INSIDE the mdf file(s) but will not release any space on hard disk.
What do think?


Too old to Rock'n'Roll too young to die.
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2217 Posts

Posted - 04/23/2013 :  07:49:09  Show Profile  Reply with Quote
quote:
Originally posted by webfred
I believe that truncate table will release space INSIDE the mdf file(s) but will not release any space on hard disk.
What do think?

Yes webfred... TRUNCATE won't release memory immediately..
It depends on several scenarios...
http://blog.sqlauthority.com/2011/01/19/sql-server-shrinking-database-is-bad-increases-fragmentation-reduces-performance/

--
Chandu
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3699 Posts

Posted - 04/23/2013 :  08:50:24  Show Profile  Reply with Quote
Not sure if OP is talking about memory, or disk usage. Seems like disk usage. In either case, deleting or truncating table will not release the resouce back to Windows OS. SQL OS will hold on to the freed up resource unless you make it release it back to Windows OS. To make it release the resource back to Windows OS, you will have to shrink the data file. But in most cases, shrinking the datafile is a bad idea. In addition to the link Chandu posted, take a look at this article to see why it is a bad idea: http://www.sqlskills.com/blogs/paul/why-you-should-not-shrink-your-data-files/

If you are short on disk space, examine what else is using up disk space. In particular, look at database log files. You can shrink them and keep their sizes small by frequent log backups (for full and bulk-logged recovery models) or using simple recovery model.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000