We help IT Professionals succeed at work.

linked server does not contain the table Error

Hi ,

I am trying to write to atable in a linked server and  I get the following error:
The OLE DB provider "SQLNCLI" for linked server "TShultz" does not contain the table ""dbo"."SamManager"."RemotePreValidateLibraryInfo"". The table either does not exist or the current user does not have permissions on that table.

The Table is in the linked server database. The Linked Server Name is "TSHULTZ" and the Database name is "SamManager"
I am writing to this database via a linked server to other tables.
Any help is greatly appreciated.

My execute query is:
INSERT INTO [TShultz].dbo.SamManager.RemotePreValidateLibraryInfo (JobID, UserID, Barcode, Status, DeviceName, InSystem) SELECT     'TestJob' AS JobID, 'Traci' AS UserID, dbo.TubeInfo.TubeInfoID AS Barcode, NULL AS status, dbo.RackInfo.DeviceName, dbo.RackInfo.InSystem
                                                FROM         dbo.RackInfo INNER JOIN
                                                                                dbo.TubeInfo ON dbo.RackInfo.RackInfoID = dbo.TubeInfo.RackInfoID AND dbo.RackInfo.DeviceName = dbo.TubeInfo.DeviceName INNER JOIN
                                                                                dbo.TempMasterList ON dbo.TubeInfo.TubeInfoID = dbo.TempMasterList.Barcode
                                                WHERE     (dbo.RackInfo.DeviceName = 'SAMRobotics2222')
Comment
Watch Question

Top Expert 2011

Commented:
does a

select top 1 * from TShultz].dbo.SamManager.RemotePreValidateLibraryInfo

work?

have you confirmed that your user does have insert priveleges on the table?

does the table have an insert trigger?
does the table have any RI constraints that you are violating , or for tables
you  don't have priveleges on?
The problem was in my INSERT INTO [TShultz].dbo.SamManager.RemotePreValidateLibraryInfo I placed the "dbo" in the wrong place.

The Correct solution is:

INSERT INTO [TShultz] SamManager.dbo.RemotePreValidateLibraryInfo (JobID, UserID, Barcode, Status, DeviceName, InSystem) SELECT     'TestJob' AS JobID, 'Traci' AS UserID, dbo.TubeInfo.TubeInfoID AS Barcode, NULL AS status, dbo.RackInfo.DeviceName, dbo.RackInfo.InSystem
                                                FROM         dbo.RackInfo INNER JOIN
                                                                                dbo.TubeInfo ON dbo.RackInfo.RackInfoID = dbo.TubeInfo.RackInfoID AND dbo.RackInfo.DeviceName = dbo.TubeInfo.DeviceName INNER JOIN
                                                                                dbo.TempMasterList ON dbo.TubeInfo.TubeInfoID = dbo.TempMasterList.Barcode
                                                WHERE     (dbo.RackInfo.DeviceName = 'SAMRobotics2222')