Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql Server 2005 Puts square brackets around column name

I have recently moved a database from Sql Server 2000 to Sql Server 2005. In the table designer, it insists on putting square brackets around a column named "Content" I don't see Content on the list of reserved words for Sql Server, so I don't understand why it is doing this. Is there a way I can prevent it?

like image 442
pthalacker Avatar asked Dec 07 '22 06:12

pthalacker


1 Answers

CONTENT is a keyword when defining an XML column with a schema.

See here.

Edit: The MSDN link is broken (per Champ's comment), so here is the relevant extract:

Creating a typed XML column is as simple as adding the name of the schema inside parentheses, as you see here:

CREATE TABLE Foo(FooID INT, someXml XML(CONTENT FooSchema))

This statement indicates that the someXml column must adhere to the XML Schema Collection named FooSchema. You can specify that the XML must be a document or that it can contain a fragment by including the appropriate keyword, DOCUMENT or CONTENT, respectively. If omitted, the default is CONTENT.

like image 126
Jeremy Smyth Avatar answered Dec 14 '22 22:12

Jeremy Smyth