How to import xml to SQL?
-
I have a large xml file and I want to importing data from it to my database using LINQ. - My database has many type of data and my xml file has null value. - xml file has multi table. In T-SQL, I used Dataset.Readxml and using SqlBulkCopy to insert dataset into SQL. My problem is xml file has null value. I want to use LINQ to write it. What should I do? Please help me.
-
I have a large xml file and I want to importing data from it to my database using LINQ. - My database has many type of data and my xml file has null value. - xml file has multi table. In T-SQL, I used Dataset.Readxml and using SqlBulkCopy to insert dataset into SQL. My problem is xml file has null value. I want to use LINQ to write it. What should I do? Please help me.
xml doesn't have 'null', so exactly what do you mean? I suspect you mean that you have an element with no value or perhaps 'nil'? If so there are two possibilities. 1. The corresponding database column allows nulls. 2. The corresponding database column does not allow nulls - thus you MUST provide a value. You would do that while processing the file. No one can tell you what a valid value for that is since it depends on business rules.
-
xml doesn't have 'null', so exactly what do you mean? I suspect you mean that you have an element with no value or perhaps 'nil'? If so there are two possibilities. 1. The corresponding database column allows nulls. 2. The corresponding database column does not allow nulls - thus you MUST provide a value. You would do that while processing the file. No one can tell you what a valid value for that is since it depends on business rules.
Yes, I mean I have an element with no value or perhap null. I want to use LINQ.I have a column date type of data is datetime. And in my xml file, date has no data. I wrote a store procedure use openxml. When I execute it, it return 01/01/1900. I want it return null.
-
I have a large xml file and I want to importing data from it to my database using LINQ. - My database has many type of data and my xml file has null value. - xml file has multi table. In T-SQL, I used Dataset.Readxml and using SqlBulkCopy to insert dataset into SQL. My problem is xml file has null value. I want to use LINQ to write it. What should I do? Please help me.
http://support.microsoft.com/kb/316005[^] http://weblogs.sqlteam.com/mladenp/archive/2007/06/18/60235.aspx[^] Hope this can help you.
-
Yes, I mean I have an element with no value or perhap null. I want to use LINQ.I have a column date type of data is datetime. And in my xml file, date has no data. I wrote a store procedure use openxml. When I execute it, it return 01/01/1900. I want it return null.
-
http://support.microsoft.com/kb/316005[^] http://weblogs.sqlteam.com/mladenp/archive/2007/06/18/60235.aspx[^] Hope this can help you.
-
you are wellcome