如何从一个数据库插入表到另一个数据库 [英] How to insert into table from one database to another database
问题描述
Iam c#和Sql server 2005
i必须从一个数据库插入数据到另一个数据库。
一个数据库是本地的,另一个是dyndns
ex:example.dyndns。 org\server是我的另一个数据库名称
如何插入到另一个数据库中从当地选择表格
插入[example.dyndns.org\ SERVER]。[MainShopWork]。[dbo.Inv_Brand]
select * from temp
但这是错误的
问候
Nirmala devi
Iam c# and Sql server 2005
i have to insert data from one database into another database.
one database is local and other is dyndns
ex:example.dyndns.org\server is my another database name
how can i insert into another database selecting the table from the local
insert into [example.dyndns.org\SERVER].[MainShopWork].[dbo.Inv_Brand]
select * from temp
but this is giving error
Regards
Nirmala devi
推荐答案
从此链接尝试解决方案1
http://stackoverflow.com/questions/3502269/how-to-insert-table -values-from-one-database-to-another-database [ ^ ]
try solution 1 from this link
http://stackoverflow.com/questions/3502269/how-to-insert-table-values-from-one-database-to-another-database[^]
继续解决方案1 ...您的代码
Further to solution 1 ... your code
insert into [example.dyndns.org\SERVER].[MainShopWork].[dbo.Inv_Brand]
select * from temp
的code-keyword>表示您有一个名为dbo.Inv_Brand的表
。
我怀疑你实际有一个表 Inv_Brand
为架构/表所有者 dbo
所以你的代码应该读
implies that you have a table called "dbo.Inv_Brand"
.
I suspect you actually have a table Inv_Brand
for the schema/table owner dbo
so your code should have read
insert into [example.dyndns.org\SERVER].[MainShopWork].[dbo].[Inv_Brand]
select * from temp
顺便说一下是给出错误应该跟着错误的措辞 - 我们无法看到你的屏幕或通过你的眼睛看到问题是什么。
By the way "is giving error" should have been followed by the wording of the error - we can't see your screen or see through your eyes to find out what the problem is.
这篇关于如何从一个数据库插入表到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!