CREATE DATABASE最终克隆了一个旧数据库 [英] CREATE DATABASE ends up cloning an old database
问题描述
我遇到了很奇怪的事情,我以前从未遇到过这个问题,或者也许我在这里错过了一些东西.
I have run into something quite odd, i haven't had this issue before, or maybe i'm missing something here.
在SQL Server Management Studio 2012中,我试图运行查询来创建新数据库,但最终克隆了一个旧数据库,我使用的代码是:
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
使用正确的名称创建数据库,但是该数据库包含与旧数据库SEC_SSG相同的表和存储过程,但是数据为空.
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.
这是怎么回事?
推荐答案
您必须已将这些对象添加到 model
数据库在某些时候是错误的.
You must have added these objects to your model
database by mistake at some point.
这将用作所有新数据库的模板.在其中创建的任何对象将出现在新数据库CREATE
-ed.
This gets used as the template for all new databases. Any objects created in there will be present in new databases CREATE
-ed.
这篇关于CREATE DATABASE最终克隆了一个旧数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!