Save XML directly to Database with C#

前端 未结 1 1857
时光取名叫无心
时光取名叫无心 2021-01-24 02:02

Here is a part of my xml file


  
    Australia
    1
    

        
1条回答
  •  孤城傲影
    2021-01-24 02:17

    SQL Server 2005+ has a native XML datatype, if you create a column, you can simply do an insert into that column, here is an insert similar to yours, this table's second column's datatype is xml

    INSERT INTO docs VALUES (1, '
       Writing Secure Code
       
          Michael
          Howard
       
       
          David
          LeBlanc
       
       39.99
    ')
    INSERT INTO docs VALUES (2, 
    '
        
       
    XML Schema
    Benefits
    Features
    ')

    0 讨论(0)
提交回复
热议问题