CREATE DATABASE最终克隆了一个旧数据库 [英] CREATE DATABASE ends up cloning an old database

查看:75
本文介绍了CREATE 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆