Avatar of rgb192
rgb192Flag for United States of America

asked on 

upadate database1.table1 wirh values from database2.table1

upadate database1.table1 wirh values from database2.table1
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
rgb192
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image


Create a linked database then you can use this format

insert into database1.dbo.table1
select * from database2.dbo.table2
Avatar of rgb192
rgb192
Flag of United States of America image

ASKER

Invalid object name database1.dbo.table1.    Where table1 is the new table on the first database
sorry

You have to use the server name

insert into [server1].[database1].[dbo].[table1]
select * from table2
Avatar of rgb192
rgb192
Flag of United States of America image

ASKER

use database2
insert into server.database.dbo.orderitems12
select * from orderitems

Msg 8101, Level 16, State 1, Line 1
An explicit value for the identity column in table 'server.database.dbo.orderitems12' can only be specified when a column list is used and IDENTITY_INSERT is ON.


table orderitems123 has not be created

use database2
insert into purchase.ow1222.dbo.orderitems123
select * from orderitems
Invalid object name 'database.dbo.orderitems123'.
ASKER CERTIFIED SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of rgb192
rgb192
Flag of United States of America image

ASKER

thanks
Microsoft SQL Server 2005
Microsoft SQL Server 2005

Microsoft SQL Server 2005 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. It includes support for managing XML data and allows a database server to be exposed over web services using Tabular Data Stream (TDS) packets encapsulated within SOAP (protocol) requests.

72K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo