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 2005 Forums
 Transact-SQL (2005)
 script error

Author  Topic 

ranganath
Posting Yak Master

209 Posts

Posted - 2009-01-05 : 12:28:02
hi

Iam pulling the data from one server to another server. but iam getting the error. this is myscript

TRUNCATE TABLE [209.11.252.132].[FoxFast_Content].[dbo].Title_Synopsis

INSERT INTO [209.11.252.132].[FoxFast_Content].[dbo].Title_Synopsis
(
Title_Object_Object_Id,Wpr_Synopsis,Short_Description,Medium_Description,Long_Description
)
SELECT Object_Object_Id, Wpr_Synopsis, Short_Description, Medium_Description, Long_Description
FROM Titles

Error :
The object name '209.11.252.132.FoxFast_Content.dbo.Titles' contains more than the maximum number of prefixes. The maximum is 2.



tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-05 : 12:29:44
You can not run TRUNCATE TABLE on a remote table using a linked server. You can use DELETE though.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-05 : 12:30:22
have you added server as a linked server to your current one? Also why are you refering it by IP name? doesnt it have an alias?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-05 : 12:35:27
Also, it should work using sp_executesql as you are tricking it:

EXEC LinkedServer1.Database1.dbo.sp_executesql 'TRUNCATE TABLE dbo.Table1'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -