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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:53:30+00:00 2026-06-16T17:53:30+00:00

I have the following example of table content + Column1 | Column2 | Column3

  • 0

I have the following example of table content

+ Column1 | Column2 | Column3 +
+---------|---------|---------+
+   1     | val.txt |         +
+   2     | test.xls|         +
+   3     | abc.dwg |         +
+   4     | y.txt   |         +
+---------|---------|---------+

I want to update Column3 with information from Column2, which means I want to (in this case) extract the extension from Column2 and put it in Column3.

I want the result to look like

+ Column1 | Column2 | Column3 +
+---------|---------|---------+
+   1     | val.txt |   .txt  +
+   2     | test.xls|   .xls  +
+   3     | abc.dwg |   .dwg  +
+   4     | y.txt   |   .txt  +
+---------|---------|---------+

How to do that with an UPDATE statement?

I know how to extract the extension:

SUBSTRING(Column2, LEN(Column2)-3, LEN(Column2)) AS Extension
  • 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-16T17:53:31+00:00Added an answer on June 16, 2026 at 5:53 pm

    How about this:

    UPDATE dbo.YourTable
    SET Column3 = SUBSTRING(Column2, LEN(Column2)-3, LEN(Column2)) 
    

    If needed, you can also include a WHERE clause to limit the rows being updated, e.g.:

    UPDATE dbo.YourTable
    SET Column3 = SUBSTRING(Column2, LEN(Column2)-3, LEN(Column2)) 
    WHERE Column3 IS NULL
    

    or something like that.

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

Sidebar

Related Questions

I have the following example in a SQL table Cust Group Sales A 1
Ok, I have an example table with the following information and query. First up
I have the following query in VBA: DoCmd.RunSQL INSERT INTO table (value) VALUES ('example')
For example: In my table I have text field with following text: The quick
I have the following jquery $('#example').tableDnD({ onDrop: function (table, row) { alert(JSON.stringify($('#example').tableDnDSerialize())); var data
I have a mysql table with following columns: filterid productid value groupid I want
I have the following Table example here: http://jsfiddle.net/Lu9y3/ Which is based on the Telerik
Say for example, I have the following two tables: TableA { _id } TableB
For example, let's say I have the following two tables: Table1: Id ---- 1
I'm trying to figure out how XSLT process namespace prefixes and have following example:

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.