in

UGISS Community

Il sito della community dello User Group Italiano di SQL Server

sql2000 - truncate table

Last post 05-20-2008 19.10 by sgovoni. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-20-2008 9.28

    • mmonte
    • Top 200 Contributor
    • Joined on 06-04-2007
    • Posts 1
    • Points 35

    sql2000 - truncate table

    Buongiorno a tutti,

    ho necessità di eseguire una 'truncate table' di tabelle in diversi linked servers ( sql2000 - sp4) come da esempio, dove sbaglio?

    truncate table NAVPROD2.dbo.DatiBlocking

    Server: Msg 911, Level 16, State 5, Line 1
    Could not locate entry in sysdatabases for database 'NAVPROD2'. No entry found with that name. Make sure that the name is entered correctly.

    NB : se eseguo la select seguente il link funziona:

     select count(*) from NAVPROD2.master.dbo.DatiBlocking

    Vi ringrazio, ciao!

     

    Filed under:
    • Post Points: 35
  • 05-20-2008 9.37 In reply to

    • sgovoni
    • Top 10 Contributor
      Male
    • Joined on 10-18-2007
    • Posts 171
    • Points 2.635

    Re: sql2000 - truncate table

    Ciao,

    nella Select hai specificato anche il DB master "NAVPROD2.master.dbo.DatiBlocking" che manca nell'istruzione di Truncate.

    Ciao!

    • Post Points: 5
  • 05-20-2008 10.23 In reply to

    • lbenaglia
    • Top 25 Contributor
      Male
    • Joined on 05-14-2007
    • Vimercate (Milano)
    • Posts 88
    • Points 1.335

    Re: sql2000 - truncate table

    mmonte:

    ho necessità di eseguire una 'truncate table' di tabelle in diversi linked servers ( sql2000 - sp4) come da esempio, dove sbaglio?

    truncate table NAVPROD2.dbo.DatiBlocking

    Server: Msg 911, Level 16, State 5, Line 1
    Could not locate entry in sysdatabases for database 'NAVPROD2'. No entry found with that name. Make sure that the name is entered correctly.

    Ciao mmonte,

    la TRUNCATE TABLE non può essere eseguita su un linked server dato che può essere un data source che non ammette operazioni minimamente loggate.

    A conferma di ciò, i Books Online è riportano la seguente sintassi:

    TRUNCATE TABLE [ { database_name.[ schema_name ]. | schema_name . } ]

    table_name

    [ ; ]

    Ciao!

    Lorenzo Benaglia
    Microsoft MVP - SQL Server
    http://blogs.dotnethell.it/lorenzo
    http://italy.mvps.org
    • Post Points: 20
  • 05-20-2008 19.10 In reply to

    • sgovoni
    • Top 10 Contributor
      Male
    • Joined on 10-18-2007
    • Posts 171
    • Points 2.635

    Re: sql2000 - truncate table

    Grazie Lorenzo,

    è come dici tu... Embarrassed mi scuso, ho detto una cavolata!

    Ciao!

    Sergio

    • Post Points: 5
Page 1 of 1 (4 items)
(C) 2007 User Group Italiano di SQL Server