Quantcast
Viewing all articles
Browse latest Browse all 12963

Can SELECT data via Linked Server but can't Insert data

I have a SQL Server 2005 instance with a database I'll call DB4.  It has service ticket information.  I have a SQL Server 2008R2 instance on a different machine with some physical security data in it.  I need to find service calls related to dates of physical security events.  I have a Linked Server configured as follows.

EXEC master.dbo.sp_addlinkedserver @server = N'DB1', @srvproduct=N'SQL Server'
 /* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'DB1',@useself=N'False',@locallogin=NULL,@rmtuser=N'SomeUser',@rmtpassword='########'

GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'collation compatible', @optvalue=N'false'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'data access', @optvalue=N'true'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'dist', @optvalue=N'false'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'pub', @optvalue=N'false'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'rpc', @optvalue=N'false'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'rpc out', @optvalue=N'false'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'sub', @optvalue=N'false'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'connect timeout', @optvalue=N'0'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'collation name', @optvalue=null
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'lazy schema validation', @optvalue=N'false'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'query timeout', @optvalue=N'0'
GO

EXEC master.dbo.sp_serveroption @server=N'DB1', @optname=N'use remote collation', @optvalue=N'true'
GO

The SomeUser is a SQL Server Login on the physical security instance database, we'll call it DB1, and is in the db_owner database role in the database where I want to insert the data, we'll call that DB3, which is located on the same instance as DB1.  When I run the SELECT part against DB4, pulling in data from DB1 via Linked Server, I get the proper result set back.  When I try to insert the data into DB3 I get an error telling me "The OLE DB provider "SQLNCLI" for linked server "DB1" does not contain the table ""DB1"."dbo"."ServiceCommentsDisptchedSites2"". The table either does not exist or the current user does not have permissions on that table."

I can't figure out what is going on and would love some help.


Lee Markum


Viewing all articles
Browse latest Browse all 12963

Trending Articles