Could anyone please say me how to declare a column of xml type in sql azure table and also how to save that file from a local computer to the sql azure table?
Thanks in advance :)
Not the exact answer you are looking for but here what you can do,
BLOB, instead Azure Table. BLOB is structure designed for this purpose only.BLOB url in your Azure Table.Hope this helps you.
BLOB public or private. Generally images are stored in Public blob, so that they can be directly download from client machine. In application you can use WebClient to fetch file from BLOB. Also if you are satisfied with answer, accept them, please read FAQ. You didn't accept any answer on your questions.Accept-Rate associated, if that is low guys on SO wouldn't answer your question. Please read the FAQ.Here is the short answer:
USE YourDataBaseName
GO
CREATE TABLE Something
([SomethingID] INT PRIMARY KEY IDENTITY,
[TheColumnYouWantToDeclare] XML)
GO
With EntityFramework and LINQ to SQL, you can read the xml content and save that to the column. Here is how you can do this. Of course, you can also write SQL queries but here is how I just solved the problem with LINQPAD.
var myEntityToAdd = new Something();
var xmlContent = System.IO.File.ReadAllText(@"C:\NameOfFile.xml");
var xdoc = XDocument.Parse(xmlContent).Root;
myEntityToAdd.TheColumnYouWantToDeclare = xdoc;
Somethings.InsertOnSubmit(myEntityToAdd);
SubmitChanges();
In Azure SQL tables, you can do a lot of things with XML. Here are three videos to help you:
https://channel9.msdn.com/Series/Using-XML-in-SQL-Server-and-Azure-SQL-Database/01 https://channel9.msdn.com/Series/Using-XML-in-SQL-Server-and-Azure-SQL-Database/02 https://channel9.msdn.com/Series/Using-XML-in-SQL-Server-and-Azure-SQL-Database/03