sql - CREATE XML SCHEMA COLLECTION problem with simple quotes -



sql - CREATE XML SCHEMA COLLECTION problem with simple quotes -

i'm trying next in microsoft sql server:

create xml schema collection [dbo].[xyzschema] n'schema content' go

the problem schema content contains quote (') in regexp , breaking instruction:

n' ..... <xsd:pattern value="\w+([-+.'] ..... '

is there way escape quote , maintain correctnes of regexp, or declare expresion of create xml schema collection in other way?

you're writing varchar (well, nvarchar) literal. way escape single quotes within such literal double them up:

n' ..... <xsd:pattern value="\w+([-+.''] ..... '

from constants:

if character string enclosed in single quotation marks contains embedded quotation mark, represent embedded single quotation mark 2 single quotation marks.

sql sql-server escaping xsd

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -