sql-server - 如何在不使用create的情况下将sql server中表的内容移动到另一个表
问题描述
I'm trying to move a table in sql server to another table without the use of create. Is there any way to accomplish this.
我正在尝试使用select * from table
解决方案
您可以使用SELECT . . INTO
:
SELECT s.*
INTO <destination>
FROM <source> s;
这将创建<DESTINATION>
具有自动填充数据的表。
注意:这将复制表定义仅包括(列/数据类型)。
推荐阅读
- php - 如何防止从其他域重定向到域
- php - PHP - 将新插入的数字相加
- sqlite - 无法删除 SQLite 数据库中的行
- gstreamer - 在 RTMP 流上添加时间叠加的 Gstreamer 问题
- powershell - 使用参数从 Jenkins 管道调用 Powershell
- java - 从 Docker 容器中的 Spring Boot 应用程序下载文件
- python - Python Pandas - 如何使用键的存在来过滤具有包含字典的列的数据框?
- r - glmnet 计算时间差异 - 为什么?
- python - sql python脚本中的列表索引超出范围
- android - 使用 Kotlin 在 Android 应用中禁用复制/粘贴