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 Administration
 Transfer data from one Server to Another

Author  Topic 

mnarewec
Starting Member

10 Posts

Posted - 2009-07-07 : 17:58:58
Team
I am trying to get data from database in one server and insert into same database in another server.

I linked an instance of SQL Server 2005 (WAI_ISNT_TTS\DEVELOPMENT) to my local SQL Server 2005 Express Ed server (WAIITD91\SQLEXPRESS. It is a default instance)

Here is the script for Link Server:
EXEC sp_addlinkedserver
@server='WAI_ISNT_TTS',
@srvproduct='',
@provider='SQLNCLI',
@datasrc='WAI_ISNT_TTS\DEVELOPMENT'


Here is my script of SQL Insert Statement:
insert into WAIITD91.SQLEXPRESS.FMS.Regions
select * FROM WAI_ISNT_TTS.DEVELOPMENT.FMS.Regions


However I got this Error when executing the Insert statement Script:
The OLE DB provider "SQLNCLI" for linked server "WAI_ISNT_TTS" does not contain the table ""DEVELOPMENT"."FMS"."Regions"". The table either does not exist or the current user does not have permissions on that table.

Please advise where I went wrong. On the SQL Insert statement script or the Link Server script??

Thanks in advance for your help

Cheers!
Marsh

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-08 : 04:50:40
you need to add a login to the linked server.

Look up sp_addlinkedsrvlogin in BOL.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-07-11 : 19:30:21
quote:
Originally posted by mnarewec

Team
I am trying to get data from database in one server and insert into same database in another server.

I linked an instance of SQL Server 2005 (WAI_ISNT_TTS\DEVELOPMENT) to my local SQL Server 2005 Express Ed server (WAIITD91\SQLEXPRESS. It is a default instance)

Here is the script for Link Server:
EXEC sp_addlinkedserver
@server='WAI_ISNT_TTS',
@srvproduct='',
@provider='SQLNCLI',
@datasrc='WAI_ISNT_TTS\DEVELOPMENT'


Here is my script of SQL Insert Statement:
[green]
insert into [WAIITD91\SQLEXPRESS].DatabaseName.FMS(Schema).Regions
select * FROM FMS.Regions
[/green]

However I got this Error when executing the Insert statement Script:
The OLE DB provider "SQLNCLI" for linked server "WAI_ISNT_TTS" does not contain the table ""DEVELOPMENT"."FMS"."Regions"". The table either does not exist or the current user does not have permissions on that table.

Please advise where I went wrong. On the SQL Insert statement script or the Link Server script??

Thanks in advance for your help

Cheers!
Marsh

Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-13 : 04:20:31
And we wonder why sodeep's post count is so high..
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-07-13 : 22:26:57
Well I have slowed down nowdays.
Go to Top of Page
   

- Advertisement -