如何将表从一个数据库复制到另一个数据库 [英] how to copy the tables from one database to another

查看:110
本文介绍了如何将表从一个数据库复制到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好先生,我想用sql server management studio 2005将在一个数据库中创建的表复制到另一个数据库。我能否知道做同样的步骤

解决方案

< blockquote>参考: SQL SERVER - 2005 - 创建脚本以复制数据库模式和所有对象 - 存储过程,函数,触发器,表,视图,约束和所有其他数据库对象 [ ^ ]


也许最简单的方法是使用SELECT INTO结构。



例如e如果两个数据库都驻留在同一个SQL Server上,例如:

  SELECT  Column1,Column2 ,. ... 
INTO NewTable
FROM DatabaseName.Owner.TableName



有关详细信息,请参阅 INTO条款 [ ^ ]

hello sir,i wanted to copy tables created in one database to the other database using sql server management studio 2005. can i know the steps to do the same

解决方案

Refer: SQL SERVER – 2005 – Create Script to Copy Database Schema and All The Objects – Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects[^]


Perhaps the easiest way is to use SELECT INTO structure.

For example if both databases reside on the same SQL Server, something like:

SELECT Column1, Column2, ....
INTO NewTable
FROM DatabaseName.Owner.TableName


For more info, see INTO Clause[^]


这篇关于如何将表从一个数据库复制到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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