A表a字段所有数据 导至B表a1字段 用什么命令?

cd_turkey 2006-10-02 09:16:28
有两个数据库。并非一个产品的。
我已将数据库A数据中的需要表导出至B。

A中的字段userid   和 password 是我需要导入到B中的

请问用什么命令?
...全文
114 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Well 2006-10-04
  • 打赏
  • 举报
回复
insert into A(Col1,Col2...)
select Col1,Col2,...
from Ba
cd_turkey 2006-10-02
  • 打赏
  • 举报
回复
对不起,突然想起USER是关健:) 加上[]即可:)

谢谢
cd_turkey 2006-10-02
  • 打赏
  • 举报
回复
insert into customer(custid,fmoney) select UserID,UserMoney from user where userid>0  

说USER附近有语法错误
dawugui 2006-10-02
  • 打赏
  • 举报
回复
如果有关联字段ID

update b
set b.userid = a.userid
b.password = a.password
from a,b
where a.id = b.id

如果没有.
insert into b(userid,password) select userid,password from a where ........

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧