• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

inserting text fields sql database table

The accounting team have decided to change 150 descriptions of their chart of accounts.
the chart of account remains the same etc only the description changes.
I was thinking an insert statement would be the best way to go

would you create a table with the changes required then do an insert
SELECT column_name,column_name
 FROM table_name
 WHERE column_name operator value;

see example attached
Amanda Walshaw
Amanda Walshaw
1 Solution
It would probably be an update statement.

First add an additional field to the existing table, say, description.


Update yourExistingTable

Set description = 'value' where accountCode='accoutncodeValue'

It will be tedious but that's the only I can ensure desciptions go to correct accountCode value.
Scott PletcherSenior DBACommented:
Import the spreadsheet, then UPDATE the existing chart-of-accounts table using that:

SET description = [is].[New Account Description]
FROM dbo.chart_of_accounts coa
INNER JOIN dbo.imported_spreadsheet [is] ON
    [is].[Account Code] = coa.account_code
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now