mssql

# shrink database (test)
USE Database_Name
select name,recovery_model_desc from sys.databases
ALTER DATABASE Database_Name SET RECOVERY simple
DBCC SHRINKFILE (Database_Name_log , 1)

ALTER DATABASE [mydatabase] SET RECOVERY SIMPLE
DBCC SHRINKFILE()
ALTER DATABASE [mydatabase] SET RECOVERY FULL

DBCC SHRINKFILE()
BACKUP LOG WITH TRUNCATE_ONLY
DBCC SHRINKFILE()

ALTER DATABASE mydb1 MODIFY FILE (NAME = mydb1_log, SIZE = 8192);

DBCC SHRINKFILE(mydb1_log, 124400);

ALTER DATABASE mydb1 SET RECOVERY SIMPLE

WHILE 1 = 1
BEGIN
delete TOP (100000) from mydb1.mytable1 where time < DATEADD(mm, -12, GETDATE());
END

# Links
https://community.embarcadero.com/article/articles-database/1026-5-different-ways-to-start-sql-server-services