Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to add xml to a column in a Database table

Received: by 10.68.74.201 with SMTP id w9mr12970845pbv.0.1328731748674;
        Wed, 08 Feb 2012 12:09:08 -0800 (PST)
Path: wr5ni2317pbc.0!nntp.google.com!news1.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From: Erland Sommarskog <esq...@sommarskog.se>
Newsgroups: comp.databases.ms-sqlserver
Subject: Re: How to add xml to a column in a Database table
Date: Wed, 08 Feb 2012 21:09:11 +0100
Organization: Erland Sommarskog
Lines: 23
Message-ID: <Xns9FF3D72EBFA39Yazorman@127.0.0.1>
References: <4f31c73f$0$285$14726298@news.sunsite.dk>
Mime-Version: 1.0
Injection-Info: mx04.eternal-september.org; posting-host="nBFDv6s1VJQDuF1w6hpX2A";
	logging-data="26153"; mail-complaints-to="ab...@eternal-september.org";	posting-account="U2FsdGVkX1+V8hn1TmkQ/XUAPU5QMfIo"
User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32)
Cancel-Lock: sha1:LlzEa5SlMJK+VzipP5DMo2r/D+E=
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit

Tony (johansson.anders...@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, 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