在for XML后加上 auto之类的就行了啊,有分吗,我是第一次来这儿,想要点分:)

解决方案 »

  1.   

    是吗,我早试过了,怎么报的错还是一样。我的语句是这样写的:select * from orders for xml auto.数据库是pubs.
      

  2.   

    pubs does not have an orders table, try NorthWind, or you want to use pubs, try
    select * from authors for xml auto
      

  3.   

    are you sure? if so, then something is seriously wrong with your SQL Server 2000. Last tryuse pubs
    go
    select * from authors for xml auto
    go
    use NorthWind
    go
    select * from orders for xml auto
    go
      

  4.   

    我用select * from authors正常显示,但加上for xml auto就报
    服务器: 消息 170,级别 15,状态 1,行 1
    Line 1: Incorrect syntax near 'xml'.
    难道我的sqlsever2000有问题吗,我是在保留sqlsever 7的基础上装的。
      

  5.   

    select  * from tablenamefor xml auto
      

  6.   

    谢谢wym93519924、saucer、hater,我重装SQl SERVER2000就正常了。看来在升级时不该保留SQl SERVER 7。