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 2005 Forums
 SQL Server Administration (2005)
 Query for database truncation - shrink

Author  Topic 

d3ng
Yak Posting Veteran

83 Posts

Posted - 2008-11-25 : 20:22:29
Hi experts!

I would like to ask if this SQL script for database truncation / shirnk is correct? Any suggestion for an a most effective scripts?


ALTER DATABASE {database name} SET RECOVERY SIMPLE
GO
DBCC SHRINKDATABASE({database name},TRUNCATEONLY)
GO
ALTER DATABASE {database name} SET RECOVERY FULL
GO


sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-25 : 20:26:23
It is bad practice to shrink Database like this.
Go to Top of Page

d3ng
Yak Posting Veteran

83 Posts

Posted - 2008-11-25 : 20:45:06
How? what is your suggestion?

www.itchytech.com
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-25 : 20:54:27
Read this:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Go to Top of Page
   

- Advertisement -