The sql server size file doesn't decrease when i delete my records

I have a table called test i insert 40000 records in it ,I split my database file into two file groups like this :

enter image description here

  • SQL Server 2012 - Case statement in where clause
  • Updating numerical part of value
  • SQL - Most performant manner to conditionally exlude a join? (if it's even possible)
  • SQL Server Calculated Column
  • Insert values into identity column manually and automatically in one query
  • 12 hr time format in sql like.. 02:32:00 PM
  • The size of both files based on round robin algorithm increased 160 mb as you can see .
    after this i delete the data in my table .but the size of both file (FileGroup)
    remains on 160 mb .Why ?

    One Solution collect form web for “The sql server size file doesn't decrease when i delete my records”

    This is because SQL Server is assuming that if your database got that large once, it is likely it will need to do so again. To save having to go through the overhead of requesting space from the operating system each time SQL Server wants to use some more disk space, it will simply hold on to what it has and fill it back up as required unless you manually issue a SHRINK DATABASE command.

    This is generally considered a bad idea however, unless you are very confident your database will not need that space at some point in the future.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.