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

  • Home
  • SEARCH
  • 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 7015997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:43:34+00:00 2026-05-27T22:43:34+00:00

I have a column ( col1 ) with nvarchar(max) . I am trying to

  • 0

I have a column (col1) with nvarchar(max).

I am trying to do

DECLARE @my_string NVARCHAR(max)
set @my_string = N'test'

UPDATE dbo.tab1 
SET col1 = @my_string + ISNULL(col1, N'')

no luck , I have no idea why it is happening. @marc_s

The string value in col1 getting truncated after 250 characters. This happening in both SQL Server 2005 and 2008.

  • 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-05-27T22:43:35+00:00Added an answer on May 27, 2026 at 10:43 pm

    First of all – I’m not seeing this behavior you’re reporting. How and why do you think your column gets truncated at 250 characters?? Are you using a tool to inspect the data that might be truncating the output??

    You could check the length of the column:

    SELECT col1, LEN(col1) FROM dbo.tab1
    

    Is it really only 250 characters long???

    Also: you’re mixing VARCHAR (in @my_string) and NVARCHAR (col1) which can lead to messy results. Avoid this!

    Next: if you want NVARCHAR(MAX), you need to cast your other strings to that format.

    Try this:

    DECLARE @my_string NVARCHAR(200)
    set @my_string = N'test'
    
    UPDATE dbo.tab1 
    SET col1 = CAST(@my_string AS NVARCHAR(MAX)) + ISNULL(col1, N'')
    

    As I said – in my tests, I didn’t need to do this – but maybe it works in your case?

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

Sidebar

Related Questions

I have a column which is of type nvarchar(max). How do I find the
I have a number of stored procedures structured similarly to this: DECLARE @sql NVARCHAR(MAX)
Suppose I have a set of column definitions: Col1: value11 value12 value13 Col2: value21
I have a string column (Col1) in table (Tab1). I want to write a
I have a column of type 'nvarchar(max)' that should now hold XML information instead
Lets say I have this SQL statements: ALTER TABLE dbo.[tbl] ALTER COLUMN col1 varchar(300)
I have a DataRow with columns col1 and col2. Each column has a value:
I have a non-nullable database column which has a default value set. When inserting
I am trying to create a three column page. My intention is to have
See this fiddle: http://jsfiddle.net/uqJHf/ I have set the first column to show up with

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.