How do create a t-sql script that will auto increase my current SQL Server database size to 50%.
For instance, the current database COSTDB 100 GB and I wanted to auto increase 50% every five month.
My first script will return me the current database size:
SELECT DB_NAME (Database_id) AS Database_name,
Name as logical_name, Physical_name, (size*8)/1024 SizeDB
where DB_Name (database_id) = 'COSTDB'
My second scripts should increase the current database size. However, i stuck in here.
ALTER Database COSTDB
MODIFY FILE (COSTDB_DATA, SIZE = ?? MB)
Can someone helps please and very appreciated.