web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

What are the SQL Query commands to add data for all products to an existing empty column?

(0) ShareShare
ReportReport
Posted on by

What are the SQL Query commands to add data  to an existing  empty column  for all products?

The table is called Inventory

the empty column is called Bin1

How can I populate this columns for all products without reloading all data?

*This post is locked for comments

  • Suggested answer
    Andy Miller Profile Picture
    on at
    RE: What are the SQL Query commands to add data for all products to an existing empty column?

    UPDATE Item

    SET Bin1 = 'NewDataHere'

    WHERE Bin1 = ''

  • avelez Profile Picture
    on at
    RE: What are the SQL Query commands to add data for all products to an existing empty column?

    THe other piece of info I forgot to include on the original description of the problem is that I have the information that goes on Bin1 on the CSV file. THe CSV file has the product Code   value and the Bin1 value for about 5000 product. How can I upload it via SQL query panel?

  • Community Member Profile Picture
    on at
    RE: What are the SQL Query commands to add data for all products to an existing empty column?

    ALWAYS BACKUP YOUR DATABASE BEFORE PERFORMING DATABASE OPERATIONS SUCH AS THESE.

    There are a couple things you could do, such as creating a temp table, populating it with the BULK INSERT command, then use a SQL query to copy the BIN1 values by joining the product ID in your temp table to the item lookup code in the item table. Another option is to install SQL management studio (if its not there already) and create a linked server to your CSV file; once the linked server is created you can also use an UPDATE query to set the bin1 value. I kind of like the first one as I've used it before, but both are a little "convoluted" to go into much detail. I would make a test database by backing up and recreating your production database into a new testing database. Google will give you plenty of info on the BULK INSERT and LINKED SERVERS options to get this accomplished.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans