Is truncate table works or what the alternate statement

  • I want to truncate the table residing on the other system what exactly we should do

    truncate table [192.168.0.03].mydatabase.dbo.tmpsch

    .' contains more than the maximum number of prefixes. The maximum is 2.

    its returning such error but working fine for Select statment ...

    is there any alternative

    Thanks

  • can't say I've ever tried this - bind it into an exec statement and execute on the remote server - or set up a rpc call.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • Trunacate only supports the three part naming of tables according to BOL.

    you could try using, delete or run the command directly against the server

  • Hi,

    I want to run as job on other server so executing delete statment is expensive in this case.

    So is any alternate or the way to used the Truncate syntax

  • Create a proc and exec the proc instead of 4 part truncate.

  • good , so there is no alternative to used the direct statment

  • hidayath (5/31/2011)


    good , so there is no alternative to used the direct statment

    Yes drop the table and recreate it.

    Looks like you're looking a little more at a project where SSIS is a better choice for the job.

  • yah but using sql server 2000 version

    Any how thanks 🙂

  • hidayath (5/31/2011)


    yah but using sql server 2000 version

    Any how thanks 🙂

    DTS still might be a good option...

    PS this is sql 2008 forum so you might want to pick sql 7, 2000 forum next time.

  • oh your right working on simultaneoulsy on SQL 2008 and 2000 so got messup in posting .

    🙂

  • hidayath (5/31/2011)


    oh your right working on simultaneoulsy on SQL 2008 and 2000 so got messup in posting .

    🙂

    So you're all set?

  • hmm quite 🙂

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply