How to Quickly Create a Copy of a Table using Transact-SQL
The easiest way to create a copy of a table is to use a Transact-SQL command. Use SELECT INTO to extract all the rows from an existing table into the new table. The new table must not exist already. The following example will copy the Customers table under the Sales schema to a new table calledCurrCustomers under the BizDev schema:
SELECT * INTO BizDev.CurrCustomers FROM Sales.Customers
You can also create the new table from a specific subset of columns in the original table. In this case, you specify the names of the columns to copy after the SELECT keyword. Any columns not specified are excluded from the new table. The following example copies specific columns to a new table:
SELECT CustName, Address, Telephone, Email INTO BizDev.CurrCustomers
FROM Sales.Customers
原文: http://technet.microsoft.com/en-us/magazine/dd401720.aspx
How to Quickly Create a Copy of a Table using Transact-SQL的更多相关文章
- Auto Create Editable Copy Font(Unity3D开发之二十二)
猴子原创,欢迎转载.转载请注明: 转载自Cocos2Der-CSDN,谢谢! 原文地址: http://blog.csdn.net/cocos2der/article/details/48318879 ...
- copy to tmp table
+-----+--------+-----------+--------------+---------+------+----------------------+---------+ | Id ...
- 将一个多表关联的条件查询中的多表通过 create select 转化成一张单表的sql、改为会话级别临时表 【我】
将一个多表关联的条件查询中的多表通过 create select 转化成一张单表的sql 将结果改为创建一个会话级别的临时表: -- 根据下面这两个sql CREATE TABLE revenu ...
- mysql 查询copy to tmp table造成堵塞
show full PROCESSLIST; show VARIABLES like 'tmp_table_size' set GLOBAL tmp_table_size=629145600; SHO ...
- SQL scripts
Add a column with default current date timeALTER TABLE [TableName]ADD CreatedOn DATETIME NOT NULL DE ...
- Oracle DBA需掌握的命令集锦(推荐)
第一章:日志管理 1.forcing log switches sql> alter system switch logfile; 2.forcing checkpoints sql> a ...
- copy 和 strong(或retain)的区别
http://stackoverflow.com/questions/18526909/whether-i-should-use-propertynonatomic-copy-or-propertyn ...
- [Hive - LanguageManual] Create/Drop/Alter Database Create/Drop/Truncate Table
Hive Data Definition Language Hive Data Definition Language Overview Create/Drop/Alter Database Crea ...
- Create and format Word documents using R software and Reporters package
http://www.sthda.com/english/wiki/create-and-format-word-documents-using-r-software-and-reporters-pa ...
随机推荐
- APUE 4 - 线程
对传统的UNIX进程来讲,一个进程中只有一个线程,这就意味着一个进程在同一时刻只能做一件事(即使是多核CPU).使用多线程技术, 我们可以设计程序使得一个进程在同一时刻做多件事.使用多线程编程具有以下 ...
- hdu2222 ac自动机入门
Keywords Search Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- ORACLE 本地冷迁移
需求:把oracle数据库的数据文件,redo文件,控制文件迁移到本地的其它目录. 1.测试环境: 操作系统redhat 6.3,数据库oracle 11.2.0.1.0 [root@dbtest1 ...
- Mysql 协议嗅探
需求 监听通过网卡的所有mysql流量,进行解析,可在不影响现有业务情况下,进行入侵检测(IDS)或数据集成 协议要点 起初发现 用mysql-front访问数据库和mysql 的客户端访问时数据包格 ...
- ssm搭建报错
在搭建ssm框架时候踩得坑:1.对于拦截器url-parttern的设置:第一次设置的是/** 本以为这个是表示拦截所有,没想到这是错误的写法,正确的写法是/ 启动项目不会报错,但是会出现404 ...
- SAP 发送邮件 面向对象
REPORT ZMMR0068_YYN. CONSTANTS: gc_tab TYPE c VALUE cl_bcs_convert=>gc_tab, "CL_ABAP_CHAR_UT ...
- php+openresty 部署安装
1. ecs 购买 地域: 华北 2 可用区: 随机分配 安全组 ID: sg-2533jog6k I/O 优化实例: I/O 优化实例 实例规格: 1 核 1GB 网络类型: 经典网络 带宽: 1M ...
- 张高兴的 Windows 10 IoT 开发笔记:使用 ULN2003A 控制步进电机
GitHub:https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/ULN2003A
- UVa437,The Tower of Babylon
转:http://blog.csdn.net/wangtaoking1/article/details/7308275 题意为输入若干种立方体(每种若干个),然后将立方体堆成一个塔,要求接触的两个面下 ...
- ELK系列~log4-nxlog-Fluentd-elasticsearch写json数据需要注意的几点
经验与实践 前两篇文章里我们介绍了nxlog的日志收集和转发<ELK系列~Nxlog日志收集加转发(解决log4日志换行导致json转换失败问题)>,今天我们主要总结一下,在与log4和f ...