You cannot perform a TRUNCATE TABLE via linked server since it's SQL Server
specific syntax (i.e. it's not standard SQL).
The best way is to use the DELETE OPENQUERY syntax you've already tried:
this syntax allows to (eventually) save the deleted records to AS400 journal
for recovery.
To speed up the process, you could create a new Stored Procedure on AS400
side which DROPs the table and re-create it.
You can run AS400 SP via linked server using the EXEC syntax.
On HIT Software web site you can find more useful info in the KB section
about Hit OleDB 400.
HTH
[quoted text, click to view] <albelavoro@gmail.com> wrote in message
news:1169736476.171289.15970@q2g2000cwa.googlegroups.com...
> Hi,
> first of all, sorry for my bad english.
> I use SQL SERVER 2000 and I need to use TRUNCATE TABLE on a table
> located in a linked server.
> This linked server it's an IBM AS/400 and I've got the access from SQL
> to AS/400 by a provider called Hit OleDB 400.
> If I use DELETE or the other commands like SELECT ecc. works perfectly:
>
> DELETE OPENQUERY(AS400, 'SELECT Codart FROM Prezzi WHERE Codart =
> ''15146''')
>
> Now I need to TRUNCATE the table "Prezzi" on the "DatiPC" library on
> the "AS400" linked server but, if I use:
>
> TRUNCATE TABLE AS400.DatiPC.dbo.Prezzi
>
> I'll get this message:
>
> 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.
>
> How can I do this???
>
> Thanks in advance.
>