0
  1. I have T_ABC_MASTER table which has column abcData and its image type in MS Server.
  2. I want to update the following text to abcData.
  3. Please help with any SQL script, not with the program, just need a query to do it.

TEXT

<note>
  <to1>abc`xyz</to1>
  <from2>local</from2>
  <heading>dadasd</heading>
  <body>Don't forget me this weekend!</body>
</note>
7
  • IMAGE, TEXT and NTEXT are deprecated for centuries and should not be used anymore... Convert your data to VARBINARY(MAX), VARCHAR(MAX) and NVARCHAR(MAX). In your specific case you should use the native XML type... Commented Jun 8, 2017 at 8:11
  • The image type will be removed from MS SQL in the future. Should use varbinary instead. And if you need a column to contain XML, wouldn't the XML type be a better match? Also, do you need to update it from a file? Commented Jun 8, 2017 at 8:11
  • Thanks, both, @LukStorms I don't need to update it from a file, want as text. Commented Jun 8, 2017 at 8:29
  • Then use update? update t_abc_master set abcData = '<xml></xml>' where id = @id'. Commented Jun 8, 2017 at 10:07
  • And the image type is binary, so to select it as text you need to convert or cast it. For example like this post Commented Jun 8, 2017 at 10:17

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.