Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Insert Error

Author  Topic 

KingCarlos
Yak Posting Veteran

74 Posts

Posted - 2012-03-13 : 01:13:20
Hi, If anyone can help me with the following error

Msg 7202, Level 11, State 2, Line 1
Could not find server 'DB1' in sys.servers.
Verify that the correct server name was specified.
If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

I get this error when trying to use this insert SQL Statement

insert into [DB1].[dbo].productid.serialno
select serialno from [DB2].[dbo].[A_SQL_View]

Just a note I am inserting data into a table retrievied from a SQL View.

This all seems to work on SQL instances higher than SQL Express.

Any help appreciated.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-03-13 : 01:30:14
serialno is the column ?


insert into [DB1].[dbo].productid ( serialno )
select serialno from [DB2].[dbo].[A_SQL_View]



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-13 : 15:12:25
are DB1 and DB2 in same server?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -