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
 General SQL Server Forums
 New to SQL Server Programming
 Transaction Log File - FULL

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2012-12-12 : 05:27:03
Hi,

Am working with SQL Server 2005..

I am trying to shrink the log file of the database.. Apparently, the name of the database, log and mdf is the same.

Used this code

USE gprddevelopment
GO
DBCC SHRINKFILE(<gprddevelopment>, 1)
BACKUP LOG <gprddevelopment> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<gprddevelopment>, 1)
GO


and I receive the error :

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '<'.
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '<'.



Please help..

Thanks

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2012-12-12 : 05:30:21
Try this..........
Remove that < and > symbols there

--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-12-14 : 03:39:46
make sure you read this

http://sqlserverpedia.com/blog/sql-server-backup-and-restore/backup-log-with-truncate_only-like-a-bear-trap/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

prett
Posting Yak Master

212 Posts

Posted - 2012-12-17 : 01:24:07
Before shrinking the log file, please read this link: http://www.sqlservercentral.com/articles/Administration/64582/
Go to Top of Page

EsmondNorton
Starting Member

5 Posts

Posted - 2014-11-07 : 05:14:02
For increase your server performance it is advisable but you need to distinguish between rebuilding the index & reorganising the indexes
refer the following discussion http://www.sql.recoverytoolbox.com/ & download demo Recovery Toolbox for SQL Server[url][/url]
Go to Top of Page
   

- Advertisement -