DECLARE @Baza nVarChar(128), @Datoteka nVarChar(250)

SET @Baza='Finesa'

SET @Datoteka='C:\Finesa.Xp\ArhivSQL\AutoArhiv\FinesaArhiv.dat'

BACKUP DATABASE @Baza TO DISK = @Datoteka WITH NOINIT , NOUNLOAD , NAME = @Baza, NOSKIP , STATS = 10, NOFORMAT 

EXEC sp_spaceused

DBCC SQLPERF(LOGSPACE)

DBCC ShrinkDatabase(@Baza, TRUNCATEONLY )

EXEC sp_spaceused

DBCC SQLPERF(LOGSPACE)




--SET @Baza='Finesa06'

--SET @Datoteka='E:\FinWin\Finesa.Xp\ArhivSQL\AutoArhiv\Finesa06Arhiv.dat'

--BACKUP DATABASE @Baza TO DISK = @Datoteka WITH NOINIT , NOUNLOAD , NAME = @Baza, NOSKIP , STATS = 10, NOFORMAT 

--EXEC sp_spaceused

--DBCC SQLPERF(LOGSPACE)

--DBCC ShrinkDatabase(@Baza, TRUNCATEONLY )

--EXEC sp_spaceused

--DBCC SQLPERF(LOGSPACE)
 