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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Error while transfering data between servers

Author  Topic 

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-09-29 : 02:01:09
Hello ppls

I need urgent help from you..

I want to run query batch on SOURCE DATABASE like


TRUNCATE TABLE [Destination Server].[Destination DB].[User].TestTbl

INSERT INTO [Destination Server].[Destination DB].TestTbl
SELECT * FROM [Source DB].[User].TestTbl

I am getting error

Server: Msg 117, Level 15, State 1, Line 3
The object name 'Destination Server.Destination DB.User.' contains more than the maximum number of prefixes. The maximum is 2.

what should i do i need to run this on source server only...

please help me out

T.I.A

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-29 : 02:30:24
Haven't tried it, but could you use OPENQUERY for the truncation?
Or, create a SP on the destination server that truncates the table, and call the SP from source server.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-09-29 : 07:07:52
hi peso

that OR option worked for me!!!!!!!

thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-09-29 : 08:37:12
You should have added that server as Linked Server

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -