Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2008 automatically creates table when creating new database [duplicate]

I am using SQL Server 2008. When I create a database by right clicking on the database folder and create new database, it creates the database with the name I given.

Additionally, the tables that are generated automatically are from a previously created table with different database name.

like image 986
durai Avatar asked Apr 28 '26 16:04

durai


1 Answers

When a database is created, it is created based on the model database, as described here:

The model database is used as the template for all databases created on an instance of SQL Server. Because tempdb is created every time SQL Server is started, the model database must always exist on a SQL Server system. The entire contents of the model database, including database options, are copied to the new database.

So, you probably just need to remove the tables from model.

like image 77
Gordon Linoff Avatar answered May 01 '26 15:05

Gordon Linoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!