Results 1 to 6 of 6
-
09-16-2009, 06:13 PM #1
- Join Date
- Apr 2008
- Location
- Boston, MA
- Posts
- 13,232
- Thanks
- 745
- Thanked 729 Times in 564 Posts
- Blog Entries
- 4
- Feedback Score
- 4 (100%)
Truncate MS SQL 2008 Database Log File
If you need to truncate the SQL database log files to keep them smaller in size. The process I am demonstrating here is for MS SQL 2008.–Get in the database use Test
GO
–see current file sizes
SELECT name,size from sys.database_files
–see current recovery model
select name,recovery_model_desc from sys.databases
–According to the articles if you switch the Recovery Model to Simple inactive part of the transaction log should be removed in MS SQL 2008.
–This command will reduce the log file somewhat
Alter database Test SET Recovery simple
–check if the recovery model is changed
select name,recovery_model_desc from sys.databases
–check file sizes
select name,size from sys.database_files
–changing the recovery model to Simple might not reduce the size enough. to reduce it further
DBCC SHRINKFILE (N’Test_log’ , 1)
–check file size
select name,size from sys.database_files
Source: Truncate MS SQL 2008 Database Log FileFree Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK
-
10-23-2009, 04:28 AM #2
Junior
- Join Date
- Sep 2009
- Posts
- 193
- Thanks
- 1
- Thanked 2 Times in 2 Posts
- Feedback Score
- 0
-
10-23-2009, 10:11 AM #3
- Join Date
- Apr 2008
- Location
- Boston, MA
- Posts
- 13,232
- Thanks
- 745
- Thanked 729 Times in 564 Posts
- Blog Entries
- 4
- Feedback Score
- 4 (100%)
-
07-28-2010, 08:25 PM #4
Freshman
- Join Date
- Jul 2010
- Posts
- 28
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
yep you are an expert! can't stop saying it! thanks for this info!
-
09-03-2010, 08:27 AM #5
Truncate ms sql 2008
dear if truncate table then you not recover data in future because it remove the schema of table
-
05-22-2013, 04:39 AM #6
Freshman
- Join Date
- Apr 2013
- Location
- canada
- Posts
- 35
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Good informations regarding the truncate table and its use in data base.Thanks for the posts.
Similar Threads
-
MS SQL Code Snippest
By manik in forum DatabasesReplies: 5Last Post: 04-05-2011, 02:08 AM -
Crazy Direct Movies Collection 1-6
By MoneyMonsta in forum FreebiesReplies: 8Last Post: 01-13-2011, 12:23 AM -
Ms Sql 2008
By webdigo in forum DatabasesReplies: 1Last Post: 10-21-2010, 03:14 AM -
List of database tables and stored procedures - MS SQL
By manik in forum DatabasesReplies: 0Last Post: 04-22-2010, 07:25 PM -
Brad's Sure Guide to SQL Server 2008
By sagar.best in forum Search Engine OptimizationReplies: 0Last Post: 11-19-2008, 07:02 AM



Reply With Quote



