将数据导入现有表 [英] Import Data to Existing Table

查看:29
本文介绍了将数据导入现有表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将数据从另一个数据库中的sql导入数据库中的现有表

How to import data to existing table in Database from another Database in sql

我正在尝试此操作但不起作用.它在说

I am trying this but not working . It is saying

'无法在时间戳列中插入显式值.'使用带有列列表的 INSERT 来排除时间戳列,或者将 DEFAULT 插入到 timestamp 列中.

'Cannot insert an explicit value into a timestamp column.' Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.

Insert Into [test].[dbo].[Sample$Employee]
select * from [Test1].[dbo].[Sample1$Employee]

谢谢

推荐答案

该错误消息实际上为您提供了您正在寻找的答案:

The error message actually gives you the answer you are looking for:

将 INSERT 与列列表一起使用以排除时间戳列,或将 DEFAULT 插入时间戳列.

Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.

编辑

TIMESTAMP 列无法显式写入,您需要从插入语句中排除此列,或者...如果您确实希望将时间戳数据从源表中移出,那么您将需要改变目标表中对应字段的类型.

TIMESTAMP columns cannot be explicitly written to, and you need to exclude this column from your insert statement, or... if you really want the timestamp data moved from the source table, then you will need to change the type of the corresponding field in the destination table.

这篇关于将数据导入现有表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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