Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #934

Re: How to add xml to a column in a Database table

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: How to add xml to a column in a Database table
Date 2012-02-08 21:09 +0100
Organization Erland Sommarskog
Message-ID <Xns9FF3D72EBFA39Yazorman@127.0.0.1> (permalink)
References <4f31c73f$0$285$14726298@news.sunsite.dk>

Show all headers | View raw


Tony (johansson.andersson@telia.com) writes:
> 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 ?
 
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, esquel@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

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

How to add xml  to a column in a Database table "Tony" <johansson.andersson@telia.com> - 2012-02-08 01:52 +0100
  Re: How to add xml to a column in a Database table Erland Sommarskog <esquel@sommarskog.se> - 2012-02-08 21:09 +0100

csiph-web