Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8779033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:40:44+00:00 2026-06-13T19:40:44+00:00

In Microsoft SQL Server 2008 I am attempting to insert values into an sql

  • 0

In Microsoft SQL Server 2008 I am attempting to insert values into an sql table with the columns type_id of datatype int and xml_info of datatype XML. I am using the following query:

INSERT INTO tbl_applied_devices ([type_id],[xml_info])
VALUES (1,'<Profile ID=99><Server><ID>BC4A18CA-AFB5-4268-BDA9-C990DAFE7783</ID>  <Name>localhost</Name><Services></Services></Server></Profile>')

But I keep getting this error:

Msg 9413, Level 16, State 1, Line 4
XML parsing: line 1, character 13, A string literal was expected

What am I doing incorrectly?

EDIT:
I found that the source of the error is the xml element’s ID attribute, <Profile ID=99> seems to be what is causing the error. How can I correctly insert xml with an attribute ? Do I need to somehow escape one of the characters?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:40:46+00:00Added an answer on June 13, 2026 at 7:40 pm

    XML documents are textual by nature. This is not HTML for a web page, so you need ALL attribute values in quotes (single or double).

    INSERT INTO tbl_applied_devices ([type_id],[xml_info])
    VALUES (1,'<Profile ID="99"><Server><ID>BC4A18CA-AFB5-4268-BDA9-C990DAFE7783</ID>  <Name>localhost</Name><Services></Services></Server></Profile>')
    

    It’s very hard to parse the XML 1.0 specifications but here’s a Microsoft version for .Net 4.5, which is just as relevant for SQL Server XML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Microsoft SQL Server 2008, when executing .query('{xpath}/text()') on an XML stream column value,
Consider Microsoft SQL Server 2008 I need to create a table which can be
I am attempting to connect to Microsoft SQL Server 2008 R2 from within Microsoft
i'm running into a strange problem in Microsoft SQL Server 2008. I have a
I have a table with 300 million rows in Microsoft SQL Server 2008 R2.
In SSMS 2008 R2 I execute: create table aaa(col1 xml); go insert into aaa
I am using T/SQL in Microsoft SQL Server 2008 I have a table CREATE
How do i Export a Table from Microsoft SQL Server 2008 R2 to an
Using Microsoft SQL Server 2008, I have an SQL query similar to this: insert
Using Microsoft SQL Server 2008. I have a table of interest rates. I've manually

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.