Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to add xml to a column in a Database table

5 views
Skip to first unread message

Tony

unread,
Feb 7, 2012, 7:52:09 PM2/7/12
to
Hello!

I have defined a table like this. It's just for learning.
Create table MyTable (MyIntColumn int Primary KEY, MyXmlColumn xml)

The table is created fine but it's not possible to add any xml to the
MyXmlColumn
it's like the column is read only ?

//Tony

Erland Sommarskog

unread,
Feb 8, 2012, 3:09:11 PM2/8/12
to
This works for me:

Create table MyTable (MyIntColumn int Primary KEY, MyXmlColumn xml)
insert MyTable(MyIntColumn, MyXmlColumn)
VALUES(4711, '<Nisse><Hult>Vem fan är det?</Hult></Nisse>')



--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

0 new messages