Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    6

    Unanswered: Truncating table on Linked Servers

    Posts: 3
    Joined: Sep 2002
    Wednesday October 15, 2003 8:39 AM



    Hi Folks,

    I have a stored procedure trying to truncate a table on a linked server.

    This is sql syntax:

    TRUNCATE TABLE server01.database01.dbo.Tablename01

    I get this error:

    Server: Msg 117, Level 15, State 1, Line 2
    The object name 'server01.database01.dbo.' contains more
    than the maximum number of prefixes. The maximum is 2.


    Your advice and input will be greatly appreciated.

    Thanks and have a nice day.

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Looks like it is Microsoft command. Use DELETE or run sp on linked server with TRUNCATE inside.

  3. #3
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    try

    exec server01.database01.dbo.sp_executesql 'truncate table Tablename01'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •