From: William Allison on
I don't have much experience with replicated databases, but I wrote this script that I run on test databases to shrink the logs. Hope it helps. (I use the variables so I don't have to modified it, just change the database which the query is running against)


DECLARE @logname NVARCHAR(50)
DECLARE @name NVARCHAR(50)
SET @name = db_name()
SET @logname = (SELECT name FROM sys.database_files WHERE [file_id] = 2)

DBCC SHRINKFILE(@logname, 1)
BACKUP LOG @name WITH TRUNCATE_ONLY
DBCC SHRINKFILE(@logname, 1)

Submitted via EggHeadCafe - Software Developer Portal of Choice
Scrolling in WPF Toolkit?s Column Chart
http://www.eggheadcafe.com/tutorials/aspnet/0939d60c-8e17-4a27-b898-1fc772d2d6f6/scrolling-in-wpf-toolkits-column-chart.aspx
From: Nighthawk on
Hello,

the skript does not function. The Size does not change.

Nighthawk

"William Allison" <william.allison(a)hotmail.com> schrieb im Newsbeitrag
news:201081182322usenet(a)eggheadcafe.com...
> I don't have much experience with replicated databases, but I wrote this
> script that I run on test databases to shrink the logs. Hope it helps. (I
> use the variables so I don't have to modified it, just change the database
> which the query is running against)
>
>
> DECLARE @logname NVARCHAR(50)
> DECLARE @name NVARCHAR(50)
> SET @name = db_name()
> SET @logname = (SELECT name FROM sys.database_files WHERE [file_id] = 2)
>
> DBCC SHRINKFILE(@logname, 1)
> BACKUP LOG @name WITH TRUNCATE_ONLY
> DBCC SHRINKFILE(@logname, 1)
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> Scrolling in WPF Toolkit?s Column Chart
> http://www.eggheadcafe.com/tutorials/aspnet/0939d60c-8e17-4a27-b898-1fc772d2d6f6/scrolling-in-wpf-toolkits-column-chart.aspx
>