CREATE DATABASE ends up cloning an old database

不羁的心 提交于 2019-12-01 23:46:03

问题


I have run into something quite odd, i haven't had this issue before, or maybe i'm missing something here.

In SQL Server Management Studio 2012 i am trying to run a Query to create a new database but it ends up cloning an old database, the code i'm using is:

CREATE DATABASE SEC_SSG_INOUT;
GO

USE SEC_SSG_INOUT;
GO

The database gets created with the correct name but it contains the same tables and stored procedures as an old database called SEC_SSG, but with empty data.

What is going on here?


回答1:


You must have added these objects to your model database by mistake at some point.

This gets used as the template for all new databases. Any objects created in there will be present in new databases CREATE-ed.



来源:https://stackoverflow.com/questions/37060793/create-database-ends-up-cloning-an-old-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!