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 8644727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:22:16+00:00 2026-06-12T12:22:16+00:00

I have string with back slash needed to insert into the MS Sql Server

  • 0

I have string with back slash needed to insert into the MS Sql Server 2008 database using following insert sql query:

INSERT INTO Databsename.dbo.tblname
VALUES     (Getdate(),
            Getdate(),
            'NewsHoroscopetest/voice/_06101214132pm014771957.wav',
            20,
            '014771045',
            '01454545') 

Here, Insertion failed due to back slash in the string value. I have also tried using double back slash. It shows following error:

Msg 8152, Level 16, State 14, Line 1
String or binary data would be truncated.
The statement has been terminated.

How can I escape the back slash in above sql?

  • 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-12T12:22:17+00:00Added an answer on June 12, 2026 at 12:22 pm

    The problem is nothing to do with the backslash. They do not need escaping

    Probably the length of at least one of the values you are inserting is too long for the column you are inserting it into. The third value is 51 characters long and my guess is you are inserting it into a varchar(50) column.

    If you double check that and find it is not the case then the error might be arising from a similar problem in an insert trigger on the table.

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

Sidebar

Related Questions

I have class with back reference: public class Employee : Entity { private string
I have a web application done several years back, this is done using spring
I have a website using ASP with an MS Access DB back-end for storing
I am confused with the following result, I have a string like this:- string
I have the following string: string path = C:\Users\Username\Desktop\FileName.pdf; I need to take off
I seem to be having issues. I have a query string that has values
I have the following regex type in my xsd file: <xsd:simpleType name="Host"> <xsd:restriction base="xsd:string">
I have an application which uses a SQL database. This is encapsulated by a
I have the following string mystr1 = 'mydirname' myfile = 'mydirname\myfilename' I'm trying to
I'm have a page which I sent a parameter through the query string. If

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.