Results 1 to 6 of 6
  1. #1
    manik's Avatar
    manik is offline Om Shanti!
    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%)

    Default 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 File
    Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK


  2. #2
    sinc is offline Junior
    Join Date
    Sep 2009
    Posts
    193
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Feedback Score
    0

    Default

    Thank for sharing this Information it's good.

  3. #3
    manik's Avatar
    manik is offline Om Shanti!
    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%)

    Default

    Quote Originally Posted by sinc View Post
    Thank for sharing this Information it's good.
    I have a website with huge database, GBs in size. This works well to keep it manageable
    Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK


  4. #4
    fostin is offline Freshman
    Join Date
    Jul 2010
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    yep you are an expert! can't stop saying it! thanks for this info!

  5. #5
    sbglobal is offline Banned
    Join Date
    Aug 2010
    Location
    india
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default Truncate ms sql 2008

    dear if truncate table then you not recover data in future because it remove the schema of table

  6. #6
    johnsonsteve040 is online now Freshman
    Join Date
    Apr 2013
    Location
    canada
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    Good informations regarding the truncate table and its use in data base.Thanks for the posts.

Similar Threads

  1. MS SQL Code Snippest
    By manik in forum Databases
    Replies: 5
    Last Post: 04-05-2011, 02:08 AM
  2. Crazy Direct Movies Collection 1-6
    By MoneyMonsta in forum Freebies
    Replies: 8
    Last Post: 01-13-2011, 12:23 AM
  3. Ms Sql 2008
    By webdigo in forum Databases
    Replies: 1
    Last Post: 10-21-2010, 03:14 AM
  4. Replies: 0
    Last Post: 04-22-2010, 07:25 PM
  5. Brad's Sure Guide to SQL Server 2008
    By sagar.best in forum Search Engine Optimization
    Replies: 0
    Last Post: 11-19-2008, 07:02 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS